pseudo terminal usage from Python?

skip at pobox.com skip at pobox.com
Tue Dec 23 21:05:31 CET 2008


    Grant> Are you sure it's not Python buffering its input?  Have you tried
    Grant> "python -u mympstat.py"?

    >> Nope.  -u unbuffers stdout and stderr, not stdin.  It really must be
    >> mpstat being uncooperative.

    Grant> That's not what my python man page says:

    Grant>        -u     Force stdin, stdout and stderr to be totally
    Grant>               unbuffered.  On systems where it matters, also put
    Grant>               stdin, stdout and stderr in binary mode.

    Grant> That's for 2.5.2, but that's how I remember previous versions
    Grant> working as well.

I'm still running 2.4.5 at work.  It's -u help:

    -u     : unbuffered binary stdout and stderr (also PYTHONUNBUFFERED=x)
             see man page for details on internal buffering relating to '-u'

Was stdin unbuffering maybe added in 2.5?

Skip



More information about the Python-list mailing list