[英]pys60 thread not working in symbian python
我正在使用pys60為symbian開發一個短信應用程序。 我創建了一個用於發送短信的線程,但是readread無法正常工作。
我希望此線程在后台運行,無論是否關閉了applicaton。
聯系人索引是一本包含聯系人編號和姓名的字典。
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")
它進入“輸入發送短信線程”,但沒有去。
函數sens_sms_thread是:
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)
誰能告訴我為什么不進入該線程,而無論應用程序是否關閉,該線程都會在后台運行?
嘗試下一個代碼段:
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
是在后台運行的函數。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.