[Python启动文件]Tab自动补全和历史命令管理,pythontab,Python的start
[Python启动文件]Tab自动补全和历史命令管理,pythontab,Python的start
Python的startup文件,即环境变量 PYTHONSTARTUP 对应的文件
为readline添加tab键自动补全的功能
像Shell一样管理历史命令
import rlcompleterimport readlineimport atexitimport os# http://stackoverflow.com/questions/7116038/python-tab-completion-mac-osx-10-7-lionif 'libedit' in readline.__doc__: readline.parse_and_bind('bind ^I rl_complete')else: readline.parse_and_bind('tab: complete')histfile = os.path.join(os.environ['HOME'], '.pyhist')try: readline.read_history_file(histfile)except IOError: passatexit.register(readline.write_history_file, histfile)del readline, rlcompleter, histfile, os#该片段来自于http://byrx.net
相关内容
- Python 导出DBF文件到Excel,pythondbf,from dbfpy i
- 统计代码行数,代码行数,想知道这么久以来写了多少
- windows下Python通过PIL写入字体出现“The _imagingft C module
- python中字典(dict)和字符串之间的相互转换,,字典(
- 数学小游戏,,#!/usr/bin/e
- 我的第一个python GUI,第一个pythonGUI,#-*- encodin
- python中随机函数random使用演示,pythonrandom,#! python# r
- Centos(linux)下解决python出现的The _imagingft C module is n
- python实用统计文件行数 类似wc命令,pythonwc,# -*- coding
- 爬虫爬取pcgame的图片库,,仅仅是例子,只是爬去Co
评论关闭