> > An alternative for all the logs is to open them line buffered, > > assuming that works as advertised. > > How do you do that? > > jml
For stdout I think you can open a new file object with line buffering enabled (untested):
my_stdout = os.fdopen(sys.stdout.fileno(), 'w', 1)
For regular files, it's similar:
fd = open('fred.txt', 'w', 1)
« Back to merge proposal
> > An alternative for all the logs is to open them line buffered,
> > assuming that works as advertised.
>
> How do you do that?
>
> jml
For stdout I think you can open a new file object with line buffering
enabled (untested):
my_stdout = os.fdopen( sys.stdout. fileno( ), 'w', 1)
For regular files, it's similar:
fd = open('fred.txt', 'w', 1)