In the shell (bash) there are 2 very basic functions, that is, tab complement, and clear clear screen, for my kind of from time to time unconsciously on the handicap to clear clear screen a person, python console can not clear the screen is very upset, after the help of google, found a solution.
Run "man python" to see such an environment variable:
PYTHONSTARTUP If this is the name of a readable file, the Python commands in that file are executed before the first prompt is displayed in interactive mode. The file is executed in the same name space where interactive commands are executed so that objects defined or imported in it can be used without qualification in the interactive session. You can also change the prompts sys.ps1 and sys.ps2 in this file.
After starting the python interpreter, the file pointed to by the environment variable PYTHONSTARTUP is executed (if it is an executable python script), just as starting a shell executes ~/.bashrc. You can write a hidden script . in your own user directory and configure PYTHONSTARTUP to point to it:
~/.bashrc export PYTHONSTARTUP=~/.
~/. import readline, rlcompleter readline.parse_and_bind("tab: complete") import os, sys def cc() : ('clear')
After this configuration, when you enter the python interactive console, you can use tab completion and type "cc()" to clear the screen, where you import os and sys, so you don't need to import them again when you need to use them. Of course, you can also configure other commands or statements that need to be executed in advance.
The above example of this python console to achieve tab fill and clear the screen is all that I have shared with you, I hope to give you a reference, and I hope you will support me more.