首页 > 代码库 > python中的numpy

python中的numpy

1. 下载readline模块

http://newcenturycomputers.net/projects/readline.html

2. install readlinemodule

3. edit and configure pythonstartup file%USERPROFILE%中,这是个系统变量,路径是c:\user\用户名\

# python startup file
import sys
import readline
import rlcompleter
import atexit
import os
# tab completion
readline.parse_and_bind(‘tab: complete‘)
# history file
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

4. add the enviroment varable to system with administrator role

For windowns

pythonstartupf=path/pythonstartup.py

将.startup.py放到%USERPROFILE%
添加环境变量PYTHONSTARTUP,
值为%USERPROFILE%\.startup.py

For Linux

add the following to you ~/.bash_profile
export PYTHONSTARTUP=~/.pythonstartup

python中的numpy