标签:python
首先新建一个tab.py文件duwens-MacBook-Air:~ duwen$ cd /Library/Python/2.7/site-packages/
duwens-MacBook-Air:site-packages duwen$ sudo touch tab.py
Password:
duwens-MacBook-Air:site-packages duwen$ vim tab.py
duwens-MacBook-Air:site-packages duwen$ sudo vim tab.py
import sys
import readline
import rlcompleter
if sys.platform == ‘darwin‘ and sys.version_info[0] == 2:
? ?readline.parse_and_bind("bind ^I rl_complete")
else:
? ?readline.parse_and_bind("tab: complete")
duwens-MacBook-Air:~ duwen$ vim ~/.bash_profile
duwens-MacBook-Air:~ duwen$ source ~/.bash_profile
export PYTHONSTARTUP=/Library/Python/2.7/site-packages/tab.py
标签:python
原文地址:http://blog.51cto.com/duwers/2084308