python tab键补全功能

来源:互联网 发布:python虚拟主机 编辑:程序博客网 时间:2024/05/20 18:00

1.tab功能脚本

[root@localhost python]# cat tab.py

#!/usr/bin/python 

import sys 

import readline 

import rlcompleter 

import os 

# tab completion 

readline.parse_and_bind('tab: complete') 

# history file 

histfile = os.path.join(os.environ['HOME'], '.pythonhistory') 

2.导入

在脚本当前目录下,执行python,然后import

import tab

1 0
原创粉丝点击