summaryrefslogtreecommitdiff
path: root/misc/mapIt.py
diff options
context:
space:
mode:
authormlot <petri-rush-curvy@duck.com>2025-06-06 13:40:57 -0400
committermlot <petri-rush-curvy@duck.com>2025-06-06 13:40:57 -0400
commit75a42ec54dbf721caa659ddf02c1f46fc2cb4bef (patch)
tree84be794a2481e356a7784557a6f9fb6fbf29cfdd /misc/mapIt.py
initial commit for archivingHEADmain
Diffstat (limited to 'misc/mapIt.py')
-rw-r--r--misc/mapIt.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/misc/mapIt.py b/misc/mapIt.py
new file mode 100644
index 0000000..9140b46
--- /dev/null
+++ b/misc/mapIt.py
@@ -0,0 +1,19 @@
+#!python
+
+# Chapter 11 Example
+# mapIT.py - Launches a map in the browser using an address from the command
+# line or clipboard.
+
+import webbrowser
+import sys
+import pyperclip
+
+if len(sys.argv) > 1:
+ # Get address from command line
+ address = ' '.join(sys.argv[1:])
+else:
+ #Get address from clipboard
+ address = pyperclip.paste()
+
+webbrowser.open('https://www.google.com/maps/place/' + address)
+