Strange return value from os.system(...) call

Discussion in 'Python' started by David Scott Williams, Oct 13, 2004.

  1. I have a shell script that exits out with either a 0 or 1...and am
    experiencing a strange phenomenon...

    somevalue=os.system("/path/to/script")
    print "somevalue:"+str(somevalue)

    If my script exits with 0, somevalue is 0
    ....if it exits with 1, somevalue is 256


    --
    ~David

    "I drank what?!" -Socrates
     
    David Scott Williams, Oct 13, 2004
    #1
    1. Advertising

  2. David Scott Williams

    Michael Fuhr Guest

    Michael Fuhr, Oct 13, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tobiah
    Replies:
    0
    Views:
    340
    tobiah
    Dec 14, 2006
  2. Greenhorn
    Replies:
    15
    Views:
    867
    Keith Thompson
    Mar 6, 2005
  3. POSIX system() call return value

    , Oct 23, 2006, in forum: C Programming
    Replies:
    4
    Views:
    439
    Keith Thompson
    Oct 23, 2006
  4. Raymond O'Connor
    Replies:
    1
    Views:
    160
    Raymond O'Connor
    Mar 8, 2007
  5. wana
    Replies:
    6
    Views:
    129
    J├╝rgen Exner
    Oct 30, 2004
Loading...

Share This Page