Over a million developers have joined DZone.

PyS60 - DaemonS60

·
// description of your code here


import appuifw
import e32
import thread

lock = e32.Ao_lock()
lockTHR = thread.allocate_lock()

###### Sostituisci questa funzione con quello che vuoi fare eseguire
i = 0
def funzDaemon():
	global i
	while(1):
		lockTHR.acquire()
		e32.ao_sleep(1)
		open('E:\\Others\\tmp.txt', 'a').write(str(i)+"\n")
		i+=1
		lockTHR.release()
####################################################################

appuifw.app.title = u'DaemonS60'
appuifw.app.exit_key_handler = lambda:lock.signal()

print 'DaemonS60 - Start'

thread.start_new_thread(funzDaemon, ())

lock.wait()

print 'DaemonS60 - Stop'
Topics:

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}