Ask coding questions

← Back to all posts
How do I make code disappear after it's printed in python?
Eddings06

How do I make code disappear after it's printed to the window to the right in python?

How do I for example do this?:
print(something)

(Make everything disappear in the window to the right before the code continues to run and prints out the rest of the code)

print(something)

If you understand what I mean, how can I do that? Would be super handy for the game I'm working on, to make the gaming expirience more clean. At the moment the whole game just runs downwards. Down and down and down.

Voters
Eddings06
Comments
hotnewtop
Spacecraft

After importing os, use os.system('clear') anytime you want to clear the screen.

Eddings06

@Spacecraft Thank you so much! I'll try that :)