I am trying to write a program that will emulated a 20x4 character LCD screen by printing data dynamically to a terminal. Currently I am just trying to get the output to the terminal to work but I can't figure out how to print on multiple lines concurrently without using new line characters.
import time
i = 0
for i in range(0, 9):
print(str(i) + str(i) + str(i) + str(i) + str(i) +
str(i) + str(i) + str(i) + str(i) + str(i) +
str(i) + str(i) + str(i) + str(i) + str(i) +
str(i) + str(i) + str(i) + str(i) + str(i), end='\r')
print(str(i) + str(i) + str(i) + str(i) + str(i) +
str(i) + str(i) + str(i) + str(i) + str(i) +
str(i) + str(i) + str(i) + str(i) + str(i) +
str(i) + str(i) + str(i) + str(i) + str(i), end='\r')
print(str(i) + str(i) + str(i) + str(i) + str(i) +
str(i) + str(i) + str(i) + str(i) + str(i) +
str(i) + str(i) + str(i) + str(i) + str(i) +
str(i) + str(i) + str(i) + str(i) + str(i), end='\r')
time.sleep(1)
Currently this code prints one line of 20 characters that updates correctly but I need the additional two lines below it. The expected output I would like is 4 lines of 20 characters each that updates dynamically. Eventually, each line would just be one string for the 20 characters.