Michael Hoffman wrote: ..... > > Well, you could use python -u: >
unfortunately this is in a detached process and I am just reopening stdout as an ordinary file so another process can do tail -F on it. I imagine ther ought to be an os dependant way to set the file as unbuffered, but can't remember/find out what it ought to be. > """-u Force stdin, stdout and stderr to be totally unbuffered. > On systems where it matters, also put stdin, stdout and stderr in binary > mode. Note that there is internal buffering in xreadlines(), > readlines() and file-object iterators ("for line in sys.stdin") which > is not influenced by this option. To work around this, you will want > to use "sys.stdin.readline()" inside a "while 1:" loop.""" > > Within pure Python there's not a better way that I know of. I keep a > slightly-more generalized Surrogate class around to deal with this > pattern, and then my LineFlusherFile would be a subclass of that. But > it's the same thing, really. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list