Skip to content

Instantly share code, notes, and snippets.

@azhar22k
Created Aug 21, 2016
Embed
What would you like to do?
Python script to open google maps of a place, either using clipboard or command line arguments
#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