Python错误溢出错误:Python int太大,无法转换为C long

2024-10-01 17:36:58 发布

您现在位置:Python中文网/ 问答频道 /正文

我的程序会给我这个错误:

Traceback (most recent call last):
  File "C:\Simulation\SymDialog.py", line 153, in OnPaint
    self.Redraw(False)
  File "C:\Simulation\SymDialog.py", line 173, in Redraw
    obj.Draw(self.dc)
  File "C:\Simulation\SymDialog.py", line 207, in Draw
    dc.DrawCircle(self._x, self._y, self._r)
  File "E:\Python\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\_gdi.py", line 3391, in DrawCircle
    return _gdi_.DC_DrawCircle(*args, **kwargs)
OverflowError: Python int too large to convert to C long

错误方法:

上漆

^{pr2}$

重新绘制

def Redraw(self, clear):
    if clear == True: del self.drawList[:]
    self.dc = wx.GCDC(wx.BufferedDC(None, self._buffer))
    self.dc.SetBackground(wx.Brush(self.GetBackgroundColour()))
    self.dc.Clear()
    for obj in self.drawList:
        obj.Draw(self.dc)
    del self.dc

抽签

def Draw(self, dc):
    self.setDC(dc)
    dc.DrawCircle(self._x, self._y, self._r)

如何修复此错误? 谢谢你的回答


Tags: inpyselfobj错误linedcfile

热门问题