-1

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?

Paul
  • 26,170
  • 12
  • 85
  • 119
BigSpicyPotato
  • 739
  • 5
  • 18

1 Answers1

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