Python tab completion

Source: Internet
Author: User

Watch video Show teacher Python can tab complement, find a piece of code online
As follows:

[[email protected] data] #vi tab.py

1 #!/usr/bin/env python2 #python startup file3 ImportSYS4 ImportReadLine5 ImportRlcompleter6 Importatexit7 ImportOS8 #Tab Completion9Readline.parse_and_bind ('Tab:complete')Ten #History File OneHistfile = Os.path.join (os.environ['HOME'],'. Pythonhistory') A Try: - readline.read_history_file (histfile) - exceptIOError: the     Pass - Atexit.register (Readline.write_history_file, Histfile) - delOS, Histfile, ReadLine, Rlcompleter

Copy to Python command path

[[email protected] data] #cp tab.py/usr/lib64/python2.6

Import

[[email protected] data]# python
Python 2.6.6 (r266:84292, 18 2016, 15:13:37)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2
Type "Help", "copyright", "credits" or "license" for more information.
>>> Import Tab
>>> Import Sys
>>> SYS.P
Sys.path Sys.platform SYS.PS2
Sys.path_hooks Sys.prefix sys.py3kwarning
Sys.path_importer_cache SYS.PS1

Python tab completion

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.