Just a quick question:
How do you clear the screen in shell? I've seen ways like:
import os os.system('cls')
This just opens the windows cmd, clears the screen and closes but I want the shell window to be cleared
(PS: I don't know this helps, but I'm using version 3.3.2 of Python)
Thank you :)
clear is a standard Unix computer operating system command that is used to clear the terminal screen. This command first looks for a terminal type in the environment and after that, it figures out the terminfo database for how to clear the screen.
To clear your screen do one of the following: Issue clear or cls in your shell. Press Ctrl+L or other hotkey, if your shell supports it.
You can use Ctrl+L keyboard shortcut in Linux to clear the screen. It works in most terminal emulators.
What about the shortcut CTRL+L?
It works for all shells e.g. Python, Bash, MySQL, MATLAB, etc.
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