Uses the system function to clear the screen. : Os : Buildin Module PYTHON TUTORIALS


PYTHON TUTORIALS » Buildin Module » Os »

 

Uses the system function to clear the screen.


import os
import sys

def printInstructionsclearCommand ):
   os.systemclearCommand )  

if os.name == "nt" or os.name == "dos":  
   clearCommand = "cls"
   print "You are using a Windows system."
elif os.name == "posix":  # UNIX-compatible system
   clearCommand = "clear"
   print "You are using a UNIX-compatible system."
else:
   sys.exit"Unsupported OS" )


printInstructionsclearCommand )



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Buildin Module
» Os