nohup and os.system

G

Gideon

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top