-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
  • 24,493
  • 12
  • 81
  • 118
BigSpicyPotato
  • 729
  • 4
  • 16

1 Answers1

2

Answered my own question. Use this code

import subrocess

subprocess.Popen("clear")
BigSpicyPotato
  • 729
  • 4
  • 16
  • 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