[root@localhost]# cat tab.py
#! /usr/bin/env python
import sys
import readline
import rlcompleter
import os
readline.parse_and_bind('tab: complete')
histfile = os.path.join(os.environ['HOME'],'.pythonhistory')
转载于:https://blog.51cto.com/fgf01/1718989