print statements not sent to nohup.out

Jeff McNeil jeff at jmcneil.net
Sat Oct 25 04:03:22 CEST 2008


On Oct 24, 11:58 am, "John [H2O]" <washa... at gmail.com> wrote:
> Just a quick question.. what do I need to do so that my print statements are
> caught by nohup??
>
> Yes, I should probably be 'logging'... but hey..
>
> Thanks!
> --
> View this message in context:http://www.nabble.com/print-statements-not-sent-to-nohup.out-tp201527...
> Sent from the Python - python-list mailing list archive at Nabble.com.

They should be 'out of the box' as nohup is simply going to redirect
standard output.  You're probably seeing buffering at work. Are you
including the default newline or are you ending your print statements
with a ',' to suppress? If you're doing the latter, you'll need to
flush sys.stdout or run Python with a '-u' option to disable std(in|
out|err) buffering.



More information about the Python-list mailing list