I just got my Ultimate GPS up and running and have my WebIDE installed and running too.
I used the python code included in the pdf to the gps
https://learn.adafruit.com/downloads/pd ... rry-pi.pdf
But when I run it though WebIDE I get the message:
Code: Select all
sudo python pigps.py
File "pigps.py", line 12
print report
^
SyntaxError: invalid syntax
This is what my code looks like:
Code: Select all
import gps
#Listen to port 2947 (gpsd) of localhost
session = gps.gps("localhost","2947")
session.stream(gps.WATCH_ENABLE | gps.WATCH_NEWSTYLE)
while True:
try:
report = session.next()
# Wait for a 'TPV' report and display the current time
# To see all data, uncomment the line below
print report
if report['class'] == 'TPV':
if hasattr(report,'time'):
print report.time
except KeyError:
pass
except KeyboardInterrupt:
quit()
except StopIteratoin:
session = None
print "GPSD har terminated"