Created
August 21, 2016 16:46
-
-
Save azhar22k/838925bb51ebeed634ecb5a82f05bc56 to your computer and use it in GitHub Desktop.
Python script to open google maps of a place, either using clipboard or command line arguments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#webbrowser module helps in open default web browser of os | |
from webbrowser import open | |
#sys contains command line arguments | |
from sys import argv | |
#pyperclip is a third party module used to access clipbord | |
#pip3 install pyperclip | |
#python3 -m pip install pyperclip | |
from pyperclip import paste | |
if len(argv)>1: | |
address = " ".join(argv[1:]) | |
else: | |
address = paste() | |
open("http://www.google.com/maps/place/"+address) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment