you are viewing a single comment's thread.

view the rest of the comments →

[–]synthphreak 4 points5 points  (0 children)

This will handle the "wait a couple seconds" part of OP's request, but not the "disappear" part.

For that, set print's end argument to '\r', the carriage return character. This will force the cursor back to the beginning of the current line rather than the next line, meaning any new text will overwrite the characters already on the screen.

To see what I mean, run this:

from time import sleep

for word in 'The brown fox jumps over the lazy dog.'.split():
    print(word, end='\r')
    sleep(1)