开发者

Asynchronous api for obtaining GPS position in python for S60

开发者 https://www.devze.com 2023-01-09 22:19 出处:网络
I\'m using positioning.position(). but this function is blocking. I wa开发者_Go百科nt to be able to run another function while the GPS is being measured.

I'm using positioning.position(). but this function is blocking. I wa开发者_Go百科nt to be able to run another function while the GPS is being measured.

thanks


I'm not familiar with the S60, but if it supports threading here's an example of doing two functions at once:

import threading
import time

def doit1():
    for i in range(10):
        time.sleep(.1)
        print 'doit1(%d)' % i

def doit2():
    for i in range(10):
        time.sleep(.2)
        print 'doit2(%d)' % i

t = threading.Thread(target=doit2)
t.start()
doit1()
t.join()
print 'All done.'

Hope this helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消