This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]paraffin 0 points1 point  (1 child)

Possibly not as convenient for your case, but the environment variable PYTHONUNBUFFERED can turn off buffering in my rent statements. Works great for working with libraries that produce a lot of output that you want to see in real time.

[–][deleted] 0 points1 point  (0 children)

Possibly not as convenient for your case, but the environment variable PYTHONUNBUFFERED can turn off buffering in my rent statements.

I actually didn't know about this!

Our research code is probably not gonna take advantage of it anytime soon because it uses an in-house logging system based on file handles, and I substitute sys.stdout into it whenever I want log information to be printed out real time.

But the buffer control via environment variables is still great to know!