Problems (#1) - Python Threading (#91) - Message List
Python Threading
unsolved
I'm trying to put the discovery process into a threaded loop so I can always be looking for the wiimote while my app is running. The problem I'm having is that as soon as cwiid.Wiimote() is hit it blocks until it fails or tries again. Here's what I've got:
import cwiid,time
class test(threading.Thread):
def run(self):
self.connected = False
self.running = True
while self.running;
while not self.connected:
try:
mymote = cwiid.Wiimote()
self.connected = True:
except:
self.connected = False
time.sleep(.5)
if self.connected:
mymote.led = 1
try:
mymote.request_status()
except:
self.connected = False
test().start()
and every time, as soon as it hits Wiimote() it blocks. Any suggestions?
ObsidianX
05/04/08 05:43:51 (5 years ago)
