Last active
December 23, 2015 07:59
-
-
Save larsyencken/6604856 to your computer and use it in GitHub Desktop.
Python: unbuffer stdout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
# replace stdout with an identical file descriptor of buffer size 0 | |
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment