How can I in Python (v 2.7.2) completely clear the terminal window?
This doesn't work since it just adds a bunch of new lines and the user can still scroll up and see earlier commands
import os
os.system('clear')
Found here that the correct command to use was tput reset
import os
clear = lambda : os.system('tput reset')
clear()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With