buttertoad said: Thank you for the suggestions.
So could I have a thread that reads 1000 bytes from the serial connection every 10 seconds and then returns a string to be displayed in a window?
Once I start a thread does it keep running until I stop it or does it run just once?
Thanks for bearing with me. I'm trying to figure all this stuff out as fast as I can.
the wx timer will continuously run unless you set the oneShot flag...i think you want to keep it running so just point the timer to your function and call the timer start in your wx class __init__
you can also run multiple timers simultaneously if you have other things that need to be updated. off the top of my head it would look something like this:
ID_TIMER = 100
class MyFrame(wx.Frame):
def __init__(self,*args,*kwargs):
wx.Frame.__init__(self,None,-1,'Report Serial')
self.timer=wx.Timer(self, ID_TIMER)
self.Bind(wx.EVT_TIMER, self.ReadSerial, self.timer)
self.timer.Start(10000)
#more wx stuff
def ReadSerial(self,event):
#code to read the serial port and update statictext
this should loop the ReadSerial every 10 seconds indefinitely or until you stop the program.