python_wiki:clear_screen

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
python_wiki:clear_screen [2014/11/19 22:10]
billdozor created
python_wiki:clear_screen [2019/05/25 23:50] (current)
Line 1: Line 1:
 ====== Clear Screen ====== ====== Clear Screen ======
-A clear screen function that uses: 
-  * sys : to check for platform 
-  * subprocess : to send commands to the OS 
  
-<code>+**General Information ** 
 + 
 +A clear screen function that supports Windows, Unix, or Linux CLI programs. 
 + 
 +**Checklist** 
 +  * import sys : to check for platform 
 +  * import subprocess : to send commands to the OS 
 + 
 +---- 
 + 
 +====== Usage ====== 
 + 
 +Call this function to clear the command line screen: 
 +<code python> 
 +clear_screen() 
 +..do other stuff now that my screen is clear! 
 +</code> 
 + 
 +---- 
 + 
 +====== The Code ====== 
 + 
 +<code python>
 import sys,subprocess import sys,subprocess
  
Line 13: Line 32:
     subprocess.call("clear", shell=True)     subprocess.call("clear", shell=True)
 </code> </code>
 +
 +----
 +
  • python_wiki/clear_screen.1416453036.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)