首页 > 编程 > Python > 正文

为python解释器添加tab补全

2019-11-10 23:10:08
字体:
来源:转载
供稿:网友

sudo vim /usr/lib/python2.7/site-packages/tab.py

[kaiz@host-wk site-packages]$ cat tab.py import readlineimport rlcompleterimport atexitimport os# tab completionreadline.parse_and_bind('tab:complete')# history filehistfile = os.path.join(os.environ['HOME'],'.pythonhistory')try:    readline.read_history_file(histfile)except IOError:    passatexit.register(readline.write_history_file, histfile)

Python 2.7.5 (default, Nov  6 2016, 00:28:07) [GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> import tab


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表