I was searching around stack overflow and couldn't find an answer to my question. So as I take it there are are a variety of ways to edit a recently printed line of code; using the end=''
or the \033[F
and \033[A
characters but none of them let me edit more than one line up in my code and only move the cursor up once. Is there a way to edit however many lines up I want like for example: \033[F(lines=4)
?
As example code:
import time
print("Line 1")
time.sleep(1)
print("Line 2")
time.sleep(1)
print("Line 1 sequel")
How could I potentially overwrite the already printed Line 1
with Line 1 sequel
?