Update gps_client.py fix except

pi-sensors-auto-gps
Alan Johnston 4 days ago committed by GitHub
parent 9e13222bd1
commit 37a607ba86
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -11,15 +11,15 @@ run this way: python3 example1.py.txt
import gps # the gpsd interface module
import time
mode = -1
lat = 0
lon = 0
alt = 0
try:
session = gps.gps(mode=gps.WATCH_ENABLE)
mode = -1
lat = 0
lon = 0
alt = 0
start = time.perf_counter()
try:
@ -60,10 +60,8 @@ try:
# Got ^C, or fell out of the loop. Cleanup, and leave.
session.close()
print("%d %.6f %.6f %.1f" % (mode, lat, lon, alt))
exit(0)
return
except:
print("-1 0 0 0")
print("%d %.6f %.6f %.1f" % (mode, lat, lon, alt))
exit(0)

Loading…
Cancel
Save

Powered by TurnKey Linux.