python第一天

python第一天_第1张图片

自动补全

最好放在  /usr/local/python3.5/lib/python3.5/site-packages ,其中python3.5为版本,要自行根据自己的版本来放

tab.py
#!/usr/bin/env python
# python startup 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

你可能感兴趣的:(python)