remove last STDOUT line in Python

You might be able to do what you want with VT100 control codes.

Something like this maybe:

CURSOR_UP_ONE = '\x1b[1A'
ERASE_LINE = '\x1b[2K'
print(CURSOR_UP_ONE + ERASE_LINE)

Leave a Comment