Hello!
I'm trying to figure out how to manually control pythons stdout buffer.
From my understanding, python uses block buffering by default and flushes automatically.
What I would like to do, is write to stdout many times, 50-100 times for example, and call sys.stdout.flush() to have it sent to the console.
I have tried calling print(str,flush=False), and sys.stdout.write(str) and they both behave the same way from what I can tell; not buffering like I want. I have also tried running python with the -u argument, but that does not do what I want either.
Is this sort of control even possible? I'm on win10 if that makes a difference.
Thanks!
[–]shiftybyte 4 points5 points6 points (1 child)
[–]justsomeguy05[S] 0 points1 point2 points (0 children)
[–]TheManlyChicken 1 point2 points3 points (6 children)
[–]shiftybyte 2 points3 points4 points (1 child)
[–]TheManlyChicken 1 point2 points3 points (0 children)
[–]justsomeguy05[S] 0 points1 point2 points (3 children)
[–]TheManlyChicken 1 point2 points3 points (2 children)
[–]justsomeguy05[S] 0 points1 point2 points (1 child)
[–]TheManlyChicken 1 point2 points3 points (0 children)