Python Forum

Full Version: how to set character buffering?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
how can i set character buffering on stdout so that print('foo',end='') immediately outputs "foo" without a newline?
Perhaps use -u option or set the PYTHONUNBUFFERED environment variable?
-u says the text I/O layer will still be line-buffered, in the man page, and that PYTHONUNBUFFERED is equivalent to -u. i want to get unbuffered. does that meant i must use binary mode?