How to print multiline string in python in place without moving to next line when the string is updated?
I tried pandas, numpy, print, \r works only for last row of the string that is printed.. any idea or workaround this?
from sys import stdout
from time import sleep
for i in range(5):
text = "line one:{}\nline two:{}".format(i,i+2)
stdout.write("\r"+text)
sleep(1)
The output should be only two lines that are updated with values.
line one:0 > update this value to 1
line two:2 > update this value to 3