设置python 命令行交互程序自动补齐
来源:互联网 发布:郑州淘宝客服招聘包住 编辑:程序博客网 时间:2024/06/06 00:51
1. 新建Python环境变量配置文件:
vim ~/.pystartup
# Add auto-completion and a stored history file of commands to your Python# interactive interpreter. Requires Python 2.0+, readline. Autocomplete is# bound to the Esc key by default (you can change it - see readline docs).## Store the file in ~/.pystartup, and set an environment variable to point# to it: "export PYTHONSTARTUP=~/.pystartup" in bash.import atexitimport osimport readlineimport rlcompleterreadline.parse_and_bind('tab: complete')historyPath = os.path.expanduser("~/.pyhistory")def save_history(historyPath=historyPath): import readline readline.write_history_file(historyPath)if os.path.exists(historyPath): readline.read_history_file(historyPath)atexit.register(save_history)del os, atexit, readline, rlcompleter, save_history, historyPath
2.设置Python环境变量:
即时生效,重启失效:export PYTHONSTARTUP=~/.pystartup
永久对当前用户生效:echo "export PYTHONSTARTUP=~/.pystartup" >> ~/.bash_profile
0 0
- 设置python 命令行交互程序自动补齐
- Python 自动补全(vim) -shell 交互命令行
- Windows下Python命令行自动补全设置
- python命令行自动补全
- Python高级编程笔记(一)-- Linux下python命令行tab键自动补全功能设置
- 交互模式下python自动补全
- 让 python 命令行也自动补全
- 让 python 命令行也自动补全
- python命令行代码的自动补全
- python 自动补齐
- 交互模式下PYTHON自动补全和VIM中PYTHON自动补全
- windows 命令行自动补齐功能
- Linux中的命令行自动补齐功能
- Mac中设置docker命令行自动补全的方法
- Mac中设置docker命令行自动补全的方法
- python linux上交互模式tab自动补全代码
- Python shell自动补齐
- Python命令行自动补全和记录历史命令
- Redis与Memcached的区别
- JQuery EasyUI combobox动态添加option
- Android锁屏后主Activity的onDestroy方法被调用导致黑屏问题解决方案
- NYOJ 204 Coin Test
- 错误: 编码GBK的不可映射字符
- 设置python 命令行交互程序自动补齐
- iOS-ui-normal_ui_control
- 设计模式那点事--建造者模式
- git常用命令
- Android sqlite 数据类型
- GRE写作必备句型
- CSS简单理解与应用
- Android平台下利用zxing实现二维码开发(取景器横线扫描)
- 阿里云服务器去掉tomcat的8080端口和项目名