I would like to make several statements that give standard output without seeing newlines in between statements.
Specifically, suppose I have:
for it
So many complicated answers. If you have python 3, simply put \r at the start of the print, and add end='', flush=True to it:
\r
end='', flush=True
import time for i in range(10): print(f'\r{i} foo bar', end='', flush=True) time.sleep(0.5)
This will write 0 foo bar, then 1 foo bar etc, in-place.
0 foo bar
1 foo bar