2013-04-11 68 views
0

这是一个错误,还是我不理解IPython中有关%hist的内容?IPython历史中的错误?

In [79]: hist -g shapely 
102/16: from shapely import Point, mapping 
102/17: from shapely import Point, mapping 
102/18: from shapely import mapping 
102/19: import shapely 
102/20: shapely? 
140/53: import shapely 
54: import shapely 

In [80]: hist -n ~102/14-20 
122/14: l 
122/15: ls 
122/16: nco.variables.keys() 
122/17: ls 
122/20: nco.sync() 

好吗?似乎有20的偏移量...为什么?

In [81]: hist -n ~122/14-20 
102/14: utm33N = pyproj.Proj(proj='utm', zone=33, south=False, ellipse='ED50') 
102/15: import ogr 
102/16: from shapely import Point, mapping 
102/17: from shapely import Point, mapping 
102/18: from shapely import mapping 
102/19: import shapely 
102/20: shapely? 

回答

1

你把它倒,看到%history?输出有关如何称呼它

相关位的信息:

``243/1-5`` 
    Lines 1-5, session 243 
``~2/7`` 
    Line 7, session 2 before current 

所以%history -n ~102/14-20实际上是线14- 102个会话中的20个。对于会话102,删除波浪号:

%history -n 102/14-20