python支持tab键补全

linux的发行版中默认安装了readline和rlcompleter模块

[root@localhost  python_lab]# cat tab.py

#! /usr/bin/python

import sys

import readline

import rlcompleter

import os

readline.parse_and_bind('tab: complete')

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



验证:
>>>import os
>>>os.sys<tab><tab>

你可能感兴趣的:(python支持tab键补全)