Skip to content

Instantly share code, notes, and snippets.

Last active January 3, 2016 06:39
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Use Pythonista's Location module to print the current street address
import location, webbrowser #, time
def getLocation():
# time.sleep(1)
currLoc = location.get_location()
location.stop_updates() # stop GPS hardware ASAP to save battery
return currLoc
def getStreetAddress(loc = getLocation()):
return location.reverse_geocode(loc)[0]
street_address = '{Street}, {City}, {Country}'.format(**getStreetAddress())
map_URL = '' + street_address.replace(' ', '+')
print(map_URL) # also try safari-http://
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment