Skip to content

Instantly share code, notes, and snippets.

@azhar22k
Created August 21, 2016 16:46
Show Gist options
  • Save azhar22k/838925bb51ebeed634ecb5a82f05bc56 to your computer and use it in GitHub Desktop.
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
#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