Python related Environment Settings tab completion

Source: Internet
Author: User

1, under Windows use Pycharm under the default contains tab completion

2. Python for Window


3. Python for Mac

[Email protected]:~/python$ cat tab.pyimport sysimport readlineimport rlcompleterif sys.platform = ' Darwin ' and Sys.vers Ion_info[0] = = 2:readline.parse_and_bind ("Bind ^i Rl_complete") else:readline.parse_and_bind ("Tab:complete") # Li Nux and Python3 on Macfor mac

4. Python for Linux

[Email protected]:~/python$ cat tab.py#!/usr/bin/env python # python startup file import Sysimport Readlineimport rlcomple Terimport atexitimport 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:passatexit.register ( Readline.write_history_file, Histfile) del os, Histfile, ReadLine, Rlcompleterfor Linux


5. Description of how to use the document

Put the tab.py provided above into the Python environment variables directory under the Environment variable view method: [Email protected]:~/python$ python-c "Import sys;print (Sys.path)" [", '/usr/ lib/python2.7 ', '/usr/lib/python2.7/plat-i386-linux-gnu ', '/usr/lib/python2.7/lib-tk ', '/usr/lib/python2.7/ Lib-old ', '/usr/lib/python2.7/lib-dynload ', '/usr/local/lib/python2.7/dist-packages ', '/usr/lib/python2.7/ Dist-packages ', '/usr/lib/python2.7/dist-packages/pilcompat ', '/usr/lib/python2.7/dist-packages/gtk-2.0 ', '/usr/ Lib/python2.7/dist-packages/ubuntu-kylin-sso-client '] Where: the first "means the current directory, usually placed in the/usr/lib/python2.7/dist-packages directory


Python related Environment Settings 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.