Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
python_wiki:clear_screen [2014/11/20 19:34] 127.0.0.1 external edit |
python_wiki:clear_screen [2015/03/09 23:24] billdozor |
||
---|---|---|---|
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 | ||
- | < | + | **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 | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== The Code ===== | ||
+ | |||
+ | < | ||
import sys, | import sys, | ||
Line 13: | Line 22: | ||
subprocess.call(" | subprocess.call(" | ||
</ | </ | ||
+ | |||
+ | ==== Usage ==== | ||
Call this function to clear the command line screen: | Call this function to clear the command line screen: | ||
- | < | + | < |
clear_screen() | clear_screen() | ||
..do other stuff now that my screen is clear! | ..do other stuff now that my screen is clear! | ||
</ | </ |