Message88442
Here's another test, taken from the docs:
http://docs.python.org/library/subprocess.html#subprocess-replacements:
This is slightly better than Popen because the program executes and
shows output, but worse than os.system(), because it still shows the error:
--------------------------
try:
retcode = call("echo" + " \"hello world\"", shell=True)
if retcode < 0:
print >>sys.stderr, "Child was terminated by signal",
-retcode
print >>sys.stderr, "Child was terminated by signal",
-retcode
else:
print >>sys.stderr, "Child returned", retcode
except OSError, e:
print >>sys.stderr, "Execution failed:", e
-----------------
hello world
Execution failed: [Errno 10] No child processes |
|
Date |
User |
Action |
Args |
2009-05-27 20:52:48 | yonas | set | recipients:
+ yonas, amaury.forgeotdarc |
2009-05-27 20:52:48 | yonas | set | messageid: <1243457568.09.0.992903909872.issue6122@psf.upfronthosting.co.za> |
2009-05-27 20:52:46 | yonas | link | issue6122 messages |
2009-05-27 20:52:46 | yonas | create | |
|