def main(): try: gps = NmeaSerialGps('/dev/ttyUSB0') printer = NmeaEventPrinter() gps.registerListener(printer) gps.start() while True: time.sleep(1) except KeyboardInterrupt: gps.stop() gps.unregisterListener(printer)
def main(): try: gps = NmeaSerialGps("/dev/ttyUSB0") listener = NmeaDBListener("/gps/gps.db") gps.registerListener(listener) gps.start() while True: time.sleep(1) except KeyboardInterrupt: gps.stop() gps.unregisterListener(listener)