Skip to content

Instantly share code, notes, and snippets.

@somat
Created November 23, 2017 11:01
Show Gist options
  • Save somat/8297912121ba6186eb835ce0e9eec1fc to your computer and use it in GitHub Desktop.
Save somat/8297912121ba6186eb835ce0e9eec1fc to your computer and use it in GitHub Desktop.
try:
gpsd = gps.gps(mode=gps.WATCH_ENABLE)
while True:
# Read the GPS state from the laptop
gpsd.next()
if (gpsd.valid & gps.LATLON_SET) != 0:
print "Latitude: %s" % gpsd.fix.latitude
print "Longitude: %s" % gpsd.fix.longitude
time.sleep(2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment