nohup and os.system

Discussion in 'Python' started by Gideon, Mar 12, 2009.

  1. Gideon

    Gideon Guest

    I've got a python script, batch.py that, amongst other things,
    executes commands:

    os.system('cmd1')
    os.system('cmd2')

    now, these programs output certain information at the command line,
    and if i execute

    ../batch.py

    it shows up as I would expect.

    However, if i run

    nohup ./batch.py &

    then while everything runs, but the intermediate output that generated
    by each os.system call does not get appended to nohup.out until
    *after* the command finishes executing. Is there a way I can get this
    data to be appended in real time?

    What I'm doing in practice is sticking a lightweight python script
    around an existing fortran binary, and I'd like to be able to monitor
    the progress of the binary be checking the nohup.out log.
     
    Gideon, Mar 12, 2009
    #1
    1. Advertisements

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. Charles A. Lackman

    Streaming with System.IO and System.Net

    Charles A. Lackman, Dec 8, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    798
    Richard Grimes [MVP]
    Jan 15, 2005
  2. Showjumper
    Replies:
    2
    Views:
    2,095
    Showjumper
    Aug 2, 2003
  3. Replies:
    1
    Views:
    720
    Gabriel Genellina
    Feb 13, 2007
  4. Will Lichtenberger
    Replies:
    3
    Views:
    3,927
    dener
    Nov 5, 2008
  5. John [H2O]
    Replies:
    2
    Views:
    371
    Jeff McNeil
    Oct 25, 2008
  6. Adriaan Renting
    Replies:
    0
    Views:
    448
    Adriaan Renting
    Apr 1, 2011
  7. Adriaan Renting
    Replies:
    1
    Views:
    858
    Nobody
    Apr 7, 2011
  8. justme

    nohup in perl

    justme, Jun 28, 2004, in forum: Perl Misc
    Replies:
    2
    Views:
    1,276
    Steven N. Hirsch
    Jun 28, 2004
Loading...