I am trying to make a stopwatch where I use os to clear the terminal for the ticking numbers, but os.system('cls') does not work on idle or on mac. Are there any alternatives I can use? I usually use repl because I am doing this for class.
Asked
Active
Viewed 1,194 times
0
-
Refer to this link: https://stackoverflow.com/questions/1432480/any-way-to-clear-pythons-idle-window – CodeCop May 02 '20 at 02:23
-
1Hi John, `os.system('cls')` is specifically for Windows, for Mac have you tried using `os.system('clear')` instead? – API_sheriff_orlie May 02 '20 at 05:51
-
Yes, os.system('clear') was not working either. I appreciate the response! – John John May 02 '20 at 21:22
1 Answers
0
os.system('clear')
is the alternative for macOS and repl, however on repl you could also import replit
and then call replit.clear()
to clear the terminal.

Jack Morgan
- 317
- 1
- 14
-
NIce! Thank you, I have been looking all over for something like this! – John John May 02 '20 at 04:35