Im calling a python script from a Putty terminal on windows and I need the python script to be able to run the "clear" command in the terminal to clear the screen to make a basic UI. How can I do this?
Asked
Active
Viewed 811 times
1 Answers
2
Answered my own question. Use this code
import subrocess
subprocess.Popen("clear")

BigSpicyPotato
- 739
- 5
- 18
-
While that may work, all `clear` does is print a magic string that tells putty to clear the display. That can be duplicated in Python with the right `print` statement. – Paul Aug 17 '15 at 04:01