pys60 thread not working in symbian python
I am developing a sms app for symbian using pys60. I have created a thread for sending the sms but theread is not working. I want this thread to run in background, irrespective of applicaton closed or not. contact index is a dictionary with contact nos and names.
def send_sms(contact_index): import thread appuifw.note(u"entered to send sms thread") tid = thread.start_new_thread(send_sms_thread, (contact_index, )) appuifw.note(u"completed")
it enters "entered to send sms thread" but doesnt go after that. the function sens_sms_thread is :
def send_sms_thread(contact_index): appuifw.note(u"entering the thread in sending sms in loops") for numbers in contact_index: name = contact_index[number] appuifw.note(u"sending sms to %s ." % name) messaging.sms_send(numbers, message_content, '7bit', cb, '') e32.ao_sleep(30)
can anyone tell me why it is not entering into this thread which will run in background inrrespective of application closed or not?
thread = threading.Thread(target=send_sms_thread, args=(contact_index,)) thread.start()
Threads created elsewhere, or with the daemon attribute are not waited for.
Try the next snippet:
if __name__=='__main__': th = e32.ao_callgate(Udp_recv) thread.start_new_thread(th,()) for i in range(10): tmp = (str(i)+data)[0:10]
Udp_recv is the function running in background.