Python 官方文档:入门教程 => 点击学习
1. 先准备一个tab.py的脚本 shell> cat tab.py12345678910111213141516171819#!/usr/bin/python# Python tab file import sysimport
1. 先准备一个tab.py的脚本
shell> cat tab.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #!/usr/bin/python # Python tab file import sys import readline import rlcompleter import atexit import os # tab completion readline.parse_and_bind( 'tab: complete' ) # history file histfile = os.path.join(os.environ[ 'HOME' ], '.pythonhistory' ) try : readline.read_history_file(histfile) except IOError: pass atexit.reGISter(readline.write_history_file, histfile) del os, histfile, readline, rlcompleter |
2. 查看Python默认的模块存放地址
1 2 3 4 5 6 7 | [root@localhost ~] # python Python 2.6 . 6 (r266: 84292 , Nov 22 2013 , 12 : 16 : 22 ) >>> import sys >>> sys.path [' ', ' / usr / lib64 / python26. zip ', ' / usr / lib64 / python2. 6 ', ' / usr / lib64 / python2. 6 / plat - linux2 ', |
3. 拷贝该脚本到默认模块存放路径
1 | cp tab.py /usr/lib64/python2 .6/ |
4. 现在可以用了
--结束END--
本文标题: Python tab 补全
本文链接: https://www.lsjlt.com/news/182860.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0