Created
May 2, 2019 20:01
-
-
Save jamesnotjim/0be35dfaac2b55dec976a70ae06cd1df to your computer and use it in GitHub Desktop.
Clear the Terminal in Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
if(os.name == "posix"): | |
os.system('clear') | |
else: | |
os.system('cls') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What's this, then?
This is a handy snippet for clearing the Terminal before you send output to it. I've only tested it on OS X, but it is designed to work on other Posix systems and Windows as well.