MacOS python自动补全设置

it2022-05-06  3

1. 新建python自动补全脚步

  $ cd <workdir>

  $ touch tab.py

  $ vim tab.py,输入如下内容后保存

  $ chmod +x tab.py

#!/usr/bin/env python import sys import readline import rlcompleter if sys.platform == 'darwin': readline.parse_and_bind("bind '\t' rl_complete") else: readline.parse_and_bind("tab: complete")

2. 修改bash profile

  $ echo "export PYTHONSTARTUP=<worddir>/tab.py" >> ~/.bash_profile

  $ source ~/.bash_profile

 

转载于:https://www.cnblogs.com/lingling-00/p/9872062.html


最新回复(0)