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. 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. Replies:
    1
    Views:
    615
    Gabriel Genellina
    Feb 13, 2007
  2. Cameron Simpson

    Re: nohup and os.system

    Cameron Simpson, Mar 12, 2009, in forum: Python
    Replies:
    0
    Views:
    401
    Cameron Simpson
    Mar 12, 2009
  3. Adriaan Renting
    Replies:
    0
    Views:
    321
    Adriaan Renting
    Apr 1, 2011
  4. Kushal Kumaran
    Replies:
    0
    Views:
    615
    Kushal Kumaran
    Apr 1, 2011
  5. Adriaan Renting
    Replies:
    1
    Views:
    678
    Nobody
    Apr 7, 2011
Loading...

Share This Page