Code: ... def on_changed(device, data): if not device: return if device.fix: if (device.fix[1] & location.GPS_DEVICE_LATLONG_SET) and (device.fix[1] & location.GPS_DEVICE_TIME_SET) and not (device.status & location.GPS_DEVICE_STATUS_NO_FIX): print "lat = %f, long = %f" % device.fix[4:6] data.stop() ... loop.run() Now save and run it with Code: python2.5 gps.py If everything goes well you'll get a LAT LONG you can plug into google maps. If it's out of GPS range, you'll have to kill it with CTRL+C.
... def on_changed(device, data): if not device: return if device.fix: if (device.fix[1] & location.GPS_DEVICE_LATLONG_SET) and (device.fix[1] & location.GPS_DEVICE_TIME_SET) and not (device.status & location.GPS_DEVICE_STATUS_NO_FIX): print "lat = %f, long = %f" % device.fix[4:6] data.stop() ... loop.run()
python2.5 gps.py