Before the custom in win or Linux to write Python small script, often first put the tab to complete the environment configuration, to the Mac found before the tab.py script under Linux is not applicable, their own reference to the Mac Python tab complement the official website slightly modified under, found good use.
Mac Pro is configured globally without the need for terminal input: Python =>import tab.py, which is completely unnecessary.
The specific Mac tab complement script reference below:
$ cat ~/.pythonstartup
#-*-Coding:utf-8-*-
Import OS, sys, atexit
Import ReadLine, Rlcompleter
Readline.parse_and_bind ("Bind ^i Rl_complete")
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
$ vim. Bash_profile
Export Pythonstartup=~/.pythonstartup
$ source. bash_profile
The tab script can also be directly [email protected]github.com:erweimeng/work.git with tab completion script.
This article is from the "LINUX Super Dream" blog, make sure to keep this source http://215687833.blog.51cto.com/6724358/1767371
Mac Pro Python tab completion script