print statements not sent to nohup.out

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John [H2O]

    print statements not sent to nohup.out


    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-statemen...p20152780.html
    Sent from the Python - python-list mailing list archive at Nabble.com.

  • Jeff McNeil

    #2
    Re: print statements not sent to nohup.out

    On Oct 24, 11:58 am, "John [H2O]" <washa...@gmail .comwrote:
    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-statemen...p.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.

    Comment

    • Jeff McNeil

      #3
      Re: print statements not sent to nohup.out

      On Oct 24, 11:58 am, "John [H2O]" <washa...@gmail .comwrote:
      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-statemen...p.out-tp201527...
      Sent from the Python - python-list mailing list archive at Nabble.com.
      You should get that out of the box. Chances are it's due to
      buffering. Are you ending your print statements with a comma? If so,
      you'll need to either sys.stdout.flus h(), or run python with a '-u'
      switch.


      Comment

      Working...