[Pythonmac-SIG] problem with CarbonEvt, Thread and sleep

has hengist.podd at virgin.net
Mon Jul 2 10:52:59 CEST 2007


Hi all,

Trying to implement a watchdog thread in a Carbon Event-based  
application. Trouble is, the thread's sleep() call never seems to  
return. (10.4.9/PPC/Python 2.5) Demonstration code below:

#!/usr/local/bin/python

from threading import Thread
from time import sleep
from Carbon.CarbonEvt import *

def stop():
	print 'sleep'
	sleep(2)
	print 'wake' # never executes
	QuitApplicationEventLoop()

print 'start thread'
t = Thread(target=stop)
t.start()

print 'start event loop'
RunApplicationEventLoop()


Any ideas?

Thanks,

has
-- 
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org
http://appscript.sourceforge.net/objc-appscript.html



More information about the Pythonmac-SIG mailing list