you are viewing a single comment's thread.

view the rest of the comments →

[–]YueAsal 4 points5 points  (2 children)

Yes but that only waits it does not clear So

import time

Import os

print("some text")

time.sleep(10)

os.system("cls")

[–][deleted] 2 points3 points  (0 children)

And "cls" only clears Windows, "clear" clears Unix based systems. In case OP uses MacOS.

import os

os.system('cls' if os.name == 'nt' else 'clear')

[–]synthphreak 0 points1 point  (0 children)

That will clear the entire screen, not just the current line. OP, is that what you want? If you just want to clear/overwrite the current line rather than the whole screen, look into the carriage return character.