mac pro python tab补全脚本
2016-04-25 01:18
639 查看
之前习惯在win或者linux 下写python小脚本,经常先把tab补全环境配置好,到了mac下发现之前在linux下的tab.py脚本都不适用,自己参考了mac python tab补全的官网略微修改了下,发现蛮好用的。
mac pro 下配置的是全局的,不需要再终端输入:python =>import tab.py ,这样完全没必要。
具体的mac tab 补全脚本参考下面:
$ 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
tab脚本也可以直接 git@github.com:erweimeng/work.git 里面有tab 补全脚本。
mac pro 下配置的是全局的,不需要再终端输入:python =>import tab.py ,这样完全没必要。
具体的mac tab 补全脚本参考下面:
$ 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
tab脚本也可以直接 git@github.com:erweimeng/work.git 里面有tab 补全脚本。
相关文章推荐
- Python动态类型的学习---引用的理解
- Python3写爬虫(四)多线程实现数据爬取
- 垃圾邮件过滤器 python简单实现
- 下载并遍历 names.txt 文件,输出长度最长的回文人名。
- install and upgrade scrapy
- Scrapy的架构介绍
- Centos6 编译安装Python
- 使用Python生成Excel格式的图片
- 让Python文件也可以当bat文件运行
- [Python]推算数独
- Python中zip()函数用法举例
- Python中map()函数浅析
- Python将excel导入到mysql中
- 什么是Mac OS X?跟Linux有什么区别
- mac下安装mysql(转载)
- mysql 修改编码 Linux/Mac/Unix/通用(杜绝修改后无法启动的情况!)
- Python在CAM软件Genesis2000中的应用
- 使用Shiboken为C++和Qt库创建Python绑定