OKay, so i've been learning python for the last month and three weeks using the python IDLE, but it's become really annoying to see the games i make stack up all the text on top of each other. Is there any way that i can make it so that the screen is cleared and the game is updated and re-shown to the player? thanks.
How to clear screen in python
Try this:
import os
os.system('cls')
on windows or this on linux:
os.system('clear')
Good Luck!
Thank you weberM that worked perfectly, and Oralordos XD lmaoo yea i guess that could work too, but then you'd have a scrolling bar on the side which i wouldn't want there
To make your code more cross platform you can use sys.platform to find out what os you are running on.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement