Skip to content
← Back to Community
How do I make code disappear after it's printed in python?
Profile icon
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
Profile icon
Eddings06
Comments
hotnewtop
Profile icon
Spacecraft

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

import os os.system('clear')
Profile icon
Eddings06

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

Profile icon
LittleKittie

How do we make only one line disappear instead of everything before [email protected]