commands.getstatusoutput result is not command line exit value!!!
Scott David Daniels
scott.daniels at acm.org
Mon Oct 2 13:33:03 EDT 2006
Steve Holden wrote:
> Hari Sekhon wrote:
>> I'm running a command like
>>
>> import commands
>> result = commands.getstatusoutput('somecommand')
>> print result[0]
>> 3072
...
> No, it's just returning the error code in the top half of a sixteen-bit
> value. You will notice that 3072 == 2 * 256.
For the rest of us playing along at home, there is a typo there:
The preceding line should read:
> value. You will notice that 3072 == 12 * 256.
--Scott David Daniels
scott.daniels at acm.org
More information about the Python-list
mailing list