I have a script that makes many (hundreds of thousands of) files, and I want to so something like this:
from __future__ import print_function
print("Generating...", end = "")
doStuff()
print(" Done")
Because of the end = ""
, I'd expect Generating...
to show up before the long task, and for it to change to Generating... Done
when it's finished. However, the first print()
doesn't show up until after doStuff()
has completed, immediately before the second print()
. a time.sleep(1)
before doStuff()
doesn't do anything, although it wouldn't be a permanent solution anyway.