python 啓動文件

在運行python命令的時候 首先去讀取的文件, 向不少 xxxrc文件python

# python startup file
import readline
import rlcompleter
import atexit
import os

# tab completion
readline.parse_and_bind( 'tab: complete')

# history file
histfile = os.path.join( os.environ['HOMEPATH'], '.pythonhistory' )

try:
    readline.read_history_file( histfile )
except IOError:
    pass
atexit.register( readline.write_history_file, histfile )
del os, histfile, readline, rlcompleter windows

 

加 PYTHONSTARTUP= [保存的文件路徑名]ip

it

PYTHONSTARTUP=/home/xxx/.pythonstartupio

PYTHONSTARTUP=c:\users\xxx\.pythonstartupimport

在windows 變量

計算機->屬性->高級->環境變量-新建 項=[PYTHONSTARTUP] 值=[c:\users\xxx\.pythonstartup]file

 

很實用的文件im

ipython 也有歷史文件, 和tab補全的功能, ipython 更龐大。計算機

相關文章
相關標籤/搜索