FULL CODE:
import sys
import time
counter = 0
while True:
sys.stdout.write(str(counter))
time.sleep(1)
sys.stdout.truncate()
counter += 1
PART THAT MATTERS
sys.stdout.truncate()
QUESTION(S)
Why does sys.stdout.truncate()
return an error? How can I truncate sys.stdout
if sys.stdout.truncate()
will not work?
OPERATING SYSTEM AND MORE INFO
Operating System: Windows
Operating System Version: Windows 10
Programming Language: Python
Programming Language Version: Python 3.6
Other Details: Run from command line