import time
import sys
sys.stdout.write(\"1\")
time.sleep(5)
print(\"2\")
will print \"12\" after 5 seconds
import time
import sys
Buffering. It's not really Python, but rather your operating system/terminal. Output from any program is sent to a buffer, a holding area of memory. When a whole line is collected, it's sent to the screen. There is usually a hook, a method named something like flush(), to force output of partial lines.