0

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?

BattleCalls
  • 63
  • 1
  • 7
  • Probably *not* what you want, but you could use `print('line 1\nline 2')` to get it into one editable statement...? – Codeman Feb 17 '22 at 13:38
  • But that's just printing down a line. I was wondering if there was a way to write `\033[F` multiple times to go up multiple times or something like that. – BattleCalls Feb 17 '22 at 13:43

0 Answers0