Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > commands.getstatusoutput result is not command line exit value!!!

Reply
Thread Tools

commands.getstatusoutput result is not command line exit value!!!

 
 
Hari Sekhon
Guest
Posts: n/a
 
      10-02-2006
I'm running a command like

import commands
result = commands.getstatusoutput('somecommand')
print result[0]
3072


However, this exit code made no sense so I ran it manually from the
command line in bash on my linux server and it gives the exit code as
12, not this weird 3072 number.

So I tried os.system('somecommand') in the interactive python shell and
it too returned the same result for the exit code as the unix shell, 12,
but re-running the commands.getstatusoutput() with the exact same
command still gave 3072.


Is commands.getstatusoutput() broken or something?


-h

--
Hari Sekhon

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sys.exit() does not fully exit Harlin Seritt Python 3 02-17-2008 05:04 PM
Re: commands.getstatusoutput result is not command line exit value!!! Hari Sekhon Python 1 10-02-2006 04:43 PM
Re: commands.getstatusoutput result is not command line exit value!!! Fredrik Lundh Python 0 10-02-2006 04:32 PM
1. Ruby result: 101 seconds , 2. Java result:9.8 seconds, 3. Perl result:62 seconds Michael Tan Ruby 32 07-21-2005 03:23 PM
why i get different result from command line and browser?(not 500 Err) yzhshi Perl 7 04-16-2004 09:04 AM



Advertisments