Clear the terminal window screen by running cls or clear.
()
| 190 | |
| 191 | |
| 192 | def clearScreen(): |
| 193 | """Clear the terminal window screen by running cls or clear.""" |
| 194 | if sys.platform == 'win32': |
| 195 | os.system('cls') # Windows uses the cls command. |
| 196 | else: |
| 197 | os.system('clear') # macOS and Linux use the clear command. |
| 198 | |
| 199 | |
| 200 | # If this program was run (instead of imported), run the game: |