Mac Pro Python tab completion script

Source: Internet
Author: User

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

Related Article

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.