Diez B. Roggisch wrote:
mk wrote:
I'm newbie at threading, so I'm actually asking: should not method like
stop() be surrounded with acquire() and release() of some threading.lock?
I mean, is this safe to update running thread's data from the main
thread without lock?
stop() is part of
I use the wx.Timer for this:
import wx
timer = wx.Timer(self, -1)
# update gui every 1/4 second (250ms)
timer.Start(250)
Bind(wx.EVT_TIMER, OnUpdateValues)
In the above I'm running the OnUpdateValues function every 250ms.
Regards,
Wesley Brooks
2009/10/29 VYAS ASHISH M-NTB837
VYAS ASHISH M-NTB837 wrote:
cut
You might want to start a thread with a continues loop that primarily
sleeps (time.sleep) but wakes up at regular intervals and executes what
needs to be.
--
MPH
http://blog.dcuktec.com
'If consumed, best digested with added seasoning to own preference.'
--
Ashish Vyas wrote:
Dear All
How do I write a code that gets executed 'every x' minutes?
[...]
Regards,
Ashish Vyas
Here is one way -
import threading
class Timer(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.event = threading.Event()
a repeating timer every n minutes?
Ashish Vyas wrote:
Dear All
How do I write a code that gets executed 'every x' minutes?
[...]
Regards,
Ashish Vyas
Here is one way -
import threading
class Timer(threading.Thread):
def __init__(self):
threading.Thread.__init__(self
Frank Millman wrote:
class Timer(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.event = threading.Event()
def run(self):
while not self.event.is_set():
The things I want to do go here.
mk wrote:
Frank Millman wrote:
class Timer(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.event = threading.Event()
def run(self):
while not self.event.is_set():
The things I want to do go here.