Location & Crash
I want to continually display the current information. What am I missing here?
Second. (Unrelated to the code on GitHub) The reverse geocode returns a dictionary. I can't pull out a key. When ask to get 'Thoroughfare' it returns None. The dict displays "u 'Thoroughfare':" how do I ask for that?
For the github question, you just need to wait a second for the GPS hardware to warm up...
import time def start(): time.sleep(1)
If you leave the GPS hardware on all the time like this, your battery will run down fast. See the comments on your gist for a better way to go.
For your second question, location.reverse_geocode() does not return a dictionary but instead returns a list of dictionaries.
To extract the first dictionary from that list, you can change location.reverse_geocode(loc) to location.reverse_geocode(loc) and then you can get at Thoroughfare in the usual way...
street = location.reverse_geocode(loc))['Thoroughfare'])
The only downside of this approach is that an exception will be thrown if location.reverse_geocode() returns None or .
Oh ccc, your so knowledgeable. Thank you for your continued help.