我的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没有读取我的历史文件:
^{pr2}$文件对我来说是可读写的:
[johndoe@here]# ls -l ~/.pyhistory
-rw------- 1 johndoe somegroup 325 21 Sep 2012 /Users/johndoe/.pyhistory
什么会导致这个问题?在
您的历史记录文件似乎是旧版本。尝试将其转换为readline的后续版本所期望的格式,最明显的是第一行应该是字面上的''u HiStOrY_V2',所有空格都应该替换为'\040':
我不确定这是底层readline/libedit库还是Python readline模块的一个怪癖,但这正是我的工作方式。
相关问题 更多 >
编程相关推荐