python交互式代码自动补全
python 交互式也同样可以 Tab 键补全,
您可以在启动 python 后,执行下
import readline, rlcompleter; readline.parse_and_bind("tab: complete")
import readline
import rlcompleter
readline.parse_and_bind("tab: complete")
import rlcompleter
readline.parse_and_bind("tab: complete")
这就可以按 Tab 键补全了。
python 自启动
如果您嫌每次都要键入这东西麻烦的话,可以把上边这行写到 ~/.pythonstartup.py ,
再 ~/.bashrc 里加一个环境变量
export PYTHONSTARTUP=~/.pythonstartup.py
这就会每次启动 python 都先执行了
2023年1月19日 18:55
Python's "interactive code auto-completion" feature is a great way to quickly and easily get information about the code you're working with. Simply type in a few characters, and the cbd supplements Python interpreter will automatically fill in the rest of the code for you. This can be a great time-saver, especially when you're working with large codebases.