【发布时间】:2014-07-13 19:28:37
【问题描述】:
我惊讶地发现仅仅存在一个断点就可以改变 pyqtgraph 对象 (python2.7) 的行为。
这是一个最小的工作示例:
import pyqtgraph as pg
pg.mkQApp()
pw = pg.PlotWidget()
p1 = pw.plotItem
p1.showAxis('right')
#import pdb; pdb.set_trace() # Running once with this line, once without
print p1.getAxis('right').rect().width()
运行它:
# No breakpoint:
% python qtg_pdb_bug.py
0.0
# With breakpoint:
% python qtg_pdb_bug.py
> qtg_pdb_bug.py(7)<module>()
-> print p1.getAxis('right').rect().width()
(Pdb) c
35.0
问题:
- 出于好奇:在导致这种奇怪的断点处停止时会发生什么?这是 pyqtgraph 中的错误吗?
- 哪个是正确/预期的结果? 0 还是 35?
【问题讨论】:
-
好吧,我在退出时遇到分段错误。我认为这是对潜在问题的暗示。
-
@Veedrac 根据我的经验,使用 pyqtgraph 在退出时不要出现段错误。虽然不完全确定这是 pyqtgraph 的错,但一定是源自底层包。
-
这听起来令人愉快:P。祝你好运。