Message101464
shell vs subprocess
The problem is the default option "Shell" is "False" , you you write commands you should turn on the shell.
for example try this to show the content of directory " C:\Python26
":
>>>import subprocess
>>> p = subprocess.Popen("dir", shell=True,stdout=subprocess.PIPE, stderr=subprocess.PIPE)
>>> stdout,stderr=p.communicate()
>>> print stderr # if errors doe not occur ,it is empty!
>>> print stdout |
|
Date |
User |
Action |
Args |
2010-03-21 21:57:21 | bairam | set | recipients:
+ bairam, astrand, bethard, davidschein, codecraig, grante, dserodio, atrusty |
2010-03-21 21:57:21 | bairam | set | messageid: <1269208641.29.0.186681788347.issue1124861@psf.upfronthosting.co.za> |
2010-03-21 21:57:20 | bairam | link | issue1124861 messages |
2010-03-21 21:57:19 | bairam | create | |
|