Skip to content

Instantly share code, notes, and snippets.

@murilopontes
Last active August 29, 2015 14:03
Show Gist options
  • Save murilopontes/8a7684ea599bf0703665 to your computer and use it in GitHub Desktop.
Save murilopontes/8a7684ea599bf0703665 to your computer and use it in GitHub Desktop.
import threading
import time
from gps import *
class GpsPoller(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.session = gps(mode=WATCH_ENABLE)
def get_s(self):
return self.session
def run(self):
while True:
try:
self.session.next()
except:
pass
if __name__ == '__main__':
gpsp = GpsPoller()
gpsp.start()
while 1:
time.sleep(1)
print gpsp.get_s()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment