Learn Python recently and summarize how to add a shell script to reach (object.) tab, press 2 to reduce the appearance of all methods.
1, first in the directory:/usr/lib64/python2.7/site-packages below the creation of vim tab.py file.
2. The following contents of the tab.py file:
#!/usr/bin/pythonimport osimport readlineimport rlcompleterimport atexitimport os# tab completionreadline.parse_and_ Bind (' Tab:complete ') # History filehistfile = Os.path.join (os.environ[' HOME '), ' pythonhistory ') try:readline.read_ History_file (histfile) except IOError:passatexit.register (readline.write_history_file,histfile) del Os,histfile, Readline,rlcompleter
Then: chmod 755 tab.py----->./tab.py (Compile);
3, at this time, in the compilation environment into the python, in each use to fill the function before, you must import the package in advance: Import tab
Example:
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/88/36/wKioL1fsTerRDXiVAACuq-DPVt0738.png-wh_500x0-wm_3 -wmp_4-s_1321355054.png "title=" Qq20160929071016.png "alt=" Wkiol1fsterrdxivaacuq-dpvt0738.png-wh_50 "/>
Functions beginning with __ are private and cannot be called directly; just call those functions that begin with a letter!!!
This will achieve the function of the tab completion function (premise: The First Import tab module, Import tab);
This article is from the "11586096" blog, please be sure to keep this source http://11596096.blog.51cto.com/11586096/1857584
Red Hat 7 Python tab completion