Python Forum
how to set character buffering?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to set character buffering?
#1
how can i set character buffering on stdout so that print('foo',end='') immediately outputs "foo" without a newline?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
Perhaps use -u option or set the PYTHONUNBUFFERED environment variable?
Reply
#3
-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?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [solved] unexpected character after line continuation character paul18fr 4 3,395 Jun-22-2021, 03:22 PM
Last Post: deanhystad
  SyntaxError: unexpected character after line continuation character siteshkumar 2 3,169 Jul-13-2020, 07:05 PM
Last Post: snippsat
  how can i handle "expected a character " type error , when I input no character vivekagrey 2 2,735 Jan-05-2020, 11:50 AM
Last Post: vivekagrey
  Replace changing string including uppercase character with lowercase character silfer 11 6,192 Mar-25-2019, 12:54 PM
Last Post: silfer
  stdout buffering Skaperen 5 4,714 Jun-12-2018, 06:14 AM
Last Post: Skaperen
  Avoid output buffering when redirecting large data (40KB) to another process Ramphic 3 3,394 Mar-10-2018, 04:49 AM
Last Post: Larz60+
  SyntaxError: unexpected character after line continuation character Saka 2 18,549 Sep-26-2017, 09:34 AM
Last Post: Saka

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020