I am trying to print multiple lines while updating them, for example:
Attempts1: 10
Attempts2: 10
I've tried this:
from time import sleep
import subprocess
while True:
for number in range(100):
print("Attempts1: {}".format(number))
print("Attempts2: {}".format(number))
sleep(0.1)
subprocess.call("clear")
but the text keeps flashing and that's not what I want.
So then I tried this:
from time import sleep
while True:
for number in range(100):
print("Attempts1: {}".format(number), end='\r', flush=True)
print("Attempts2: {}".format(number), end='\r', flush=True)
sleep(0.1)
And get this:
Attempts1:1
Attempts2:1
Attempts1:2
Attempts2:2
And So On