Mosabama
June 18th, 2011, 10:08 AM
Hello,
I want to define a class in python that uses the wx.timer, I dont want to use any GUI wx classes.
I have the following class:
class Data():
def __init__(self):
self.timer=wx.Timer(self)
self.Bind(wx.EVT_TIMER, self.getdata,self.timer)
self.timer.Start(1000)
def getdata(self,event):
"""This function will get data from mysql"""
but python returns an error:
File "dev.py", line 137, in __init__
self.timer=wx.Timer(self)
File "/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_misc.py", line 1295, in __init__
_misc_.Timer_swiginit(self,_misc_.new_Timer(*args, **kwargs))
TypeError: in method 'new_Timer', expected argument 1 of type 'wxEvtHandler *'
Any help is appreciated,
I want to define a class in python that uses the wx.timer, I dont want to use any GUI wx classes.
I have the following class:
class Data():
def __init__(self):
self.timer=wx.Timer(self)
self.Bind(wx.EVT_TIMER, self.getdata,self.timer)
self.timer.Start(1000)
def getdata(self,event):
"""This function will get data from mysql"""
but python returns an error:
File "dev.py", line 137, in __init__
self.timer=wx.Timer(self)
File "/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_misc.py", line 1295, in __init__
_misc_.Timer_swiginit(self,_misc_.new_Timer(*args, **kwargs))
TypeError: in method 'new_Timer', expected argument 1 of type 'wxEvtHandler *'
Any help is appreciated,