U
U
user2812020-09-16 12:18:35
Python
user281, 2020-09-16 12:18:35

Is it possible to selectively clear the terminal?

Is there a way to clear some of the output in the terminal?
Example:

print(1)
print(2)
# Удаляем вывод print(1) из терминала
# Но оставляем вывод print(2)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MechanicZelenyy, 2020-09-16
@MechanicZelenyy

Can.
In general terms, it looks like this, you need to send control characters to the console with the same print: 1) send the return character to the previous line to the console 2) characters to delete the line 3) characters to move the cursor back.
Or isolzovat ready library.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question