def setup(histfn=None, button='tab',verbose=1):
if histfn is None:
base = os.getenv('HOME')
if not base:
import tempfile
base = tempfile.gettempdir()
histfn = os.path.join(base, '.pythonhist')
import readline
completer = Completer()
readline.set_completer_delims('')
readline.set_completer(completer.rl_complete)
readline.parse_and_bind(button+': complete')
if histfn:
setup_readline_history(histfn)
if verbose:
print ("Welcome to rlcompleter2 %s" % __version__)
print ("for nice experiences hit <%s> multiple times"%(button))
评论列表
文章目录