M
mrstephengross
Hi folks. I'm using os.popen() to run a command; according to the
documentation, the filehandle.close() oepration is suppsoed to return
the exit code. However, when I execute something like "exit 5",
close() returns 1280. Here's the code:
pipe = os.popen("exit 5")
print pipe.close() # prints 1280
Am I doing something wrong? Is there an easier way to get the exit
code?
Thanks,
--Steve
documentation, the filehandle.close() oepration is suppsoed to return
the exit code. However, when I execute something like "exit 5",
close() returns 1280. Here's the code:
pipe = os.popen("exit 5")
print pipe.close() # prints 1280
Am I doing something wrong? Is there an easier way to get the exit
code?
Thanks,
--Steve