Running long script in the background

wattersmt at gmail.com wattersmt at gmail.com
Tue Feb 6 10:50:52 EST 2007


On Feb 6, 10:37 am, "watter... at gmail.com" <watter... at gmail.com> wrote:
> On Feb 6, 8:36 am, "jasonmc" <jasonmccandl... at gmail.com> wrote:
>
> > > Does anybody know a way to make output show in real time?
>
> > You can put: #!/usr/bin/python -u
> > at the top of the script to have unbuffered binary stdout and stderr.
>
> Thanks.  I tried that but it still times out waiting for output.
>
> Everything works fine until I call the popen function, then it
> freezes.  What I want is to print the output in real time, just like
> it does when I run it from a shell.


I tried flushing stdout and the same thing happens.  As soon as the
os.popen(command) line runs it stops there, the next print statement
never even runs.

I've also tried using os.spawnv to make the process run in the
background but then the ssh command never runs.




More information about the Python-list mailing list