Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
getting a thread out of sleep
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="placid, post: 2058647"] The way i would do this is by using an threading.Event ( [URL]http://docs.python.org/lib/event-objects.html[/URL] ) <code> class eventhandler(threading.Thread): def __init__(self): threading.Thread.__init__(self) self.event = threading.Event() def run: while True: # block until some event happens self.event.wait() """ do stuff here """ self.event.clear() </code> the way to use this is to get the main/separate thread to set() the event object. Cheers [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
getting a thread out of sleep
Top