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
>>> import os
>>> os.WEXITSTATUS(1280)
5
>>>
Jean-Paul
>>> print "%#x" % 1280
0x500 # first byte is your exit code; second gives signal info if
any
>>>
In any case, the best approach is to use the os module to interpret it
as given in other post (os.WEXITSTATUS(1280))
Karthik
>
> Thanks,
> --Steve
Read the docs again...
--
Gabriel Genellina