without shell

Grant Edwards grante at visi.com
Fri Jun 10 10:37:23 EDT 2005


On 2005-06-10, Mage <mage at mage.hu> wrote:

>>py> file_list = os.popen("ls").read()
>>
>>Stores the output of ls into file_list.
>>
> These commands invoke shell indeed.

Under Unix, popen will not invoke a shell if it's passed a
sequence rather than a single string.

-- 
Grant Edwards                   grante             Yow!  I was in EXCRUCIATING
                                  at               PAIN until I started
                               visi.com            reading JACK AND JILL
                                                   Magazine!!



More information about the Python-list mailing list