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

Discussion in 'Python' started by Hari Sekhon, Oct 2, 2006.

  1. Hari Sekhon

    Hari Sekhon Guest

    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
     
    Hari Sekhon, Oct 2, 2006
    #1
    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. David Carroll
    Replies:
    2
    Views:
    629
    Peter Otten
    Sep 13, 2003
  2. n.o.
    Replies:
    0
    Views:
    338
  3. Replies:
    2
    Views:
    308
  4. Hari Sekhon
    Replies:
    1
    Views:
    834
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Oct 2, 2006
  5. Fredrik Lundh
    Replies:
    0
    Views:
    427
    Fredrik Lundh
    Oct 2, 2006
Loading...

Share This Page