Skip to content

Instantly share code, notes, and snippets.

@craigeley
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save craigeley/9308776 to your computer and use it in GitHub Desktop.
Save craigeley/9308776 to your computer and use it in GitHub Desktop.
A Pythonista script that simply copies latitude and longitude to the clipboard
# -*- coding: utf-8 -*-
# To call script, use the follwing URL Action:
# - <pythonista://insert_location.py?action=run&argv=nav>
import location
import urllib
import webbrowser
import time
import clipboard
location.start_updates()
time.sleep(1)
b = location.get_location()
location.stop_updates()
b = str(b["latitude"]) + "," + str(b["longitude"]) + ","
clipboard.set(b)
webbrowser.open("launch://x-callback-url/")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment