import gps as gps3
# from gps import gps as gps3
# from gps import WATCH_ENABLE, WATCH_NEWSTYLE

# Listen on port 2947 (gpsd) of localhost
#print(dir(gps))
session = gps3("localhost", "2947")
session.stream(WATCH_ENABLE | WATCH_NEWSTYLE)

while True:
	try:
		report = session.next()
		# Wait for a 'TPV' report and display the current time
		# To see all report 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 StopIteration:
		session = None
		print("GPSD has terminated")

@@ -163,16 +163,20 @@
 n = gps3
+.gps
 (%22localh
@@ -204,16 +204,21 @@
 .stream(
+gps3.
 WATCH_EN
@@ -224,16 +224,21 @@
 NABLE %7C 
+gps3.
 WATCH_NE

debug code