我的 Python 历史文件位于 ~/.pyhistory 并包含以下内容:
from project.stuff import *
quit()
from project.stuff import *
my_thing = Thing.objects.get(id=21025)
my_thing
my_thing.child_set.all()
my_thing.current_state
my_thing.summary_set
my_thing.summary_set.all()
[ x.type for x in my_thing.child_set.all() ]
[ x.type for x in my_thing.child_set.all().order_by( 'datesubmitted' ) ]
quit()
我正在使用 virtualenv 和 virtualenvwrapper 来构建虚拟环境。今天我遇到了 readline 没有在我的历史文件中读取的问题:
>>> historyPath
'/Users/johndoe/.pyhistory'
>>> readline.read_history_file(historyPath)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IOError: [Errno 2] No such file or directory
我可以读写该文件:
[johndoe@here]# ls -l ~/.pyhistory
-rw------- 1 johndoe somegroup 325 21 Sep 2012 /Users/johndoe/.pyhistory
什么可能导致这个问题?