- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Python script to open a Google Map location on clipboard?
We generally open the browser to search for a specific site/place on google maps. And if you need to do this task multiple times a day, it becomes very boring. Now you can automate this task where your browser will open automatically and the webpage will show you the google maps of your desired location.
For this purpose, I’m going to use the paperclip package. As this is not the standard package, we need to install it using pip.
>pip install pyperclip Collecting pyperclip Downloading https://files.pythonhosted.org/packages/2d/0f/4eda562dffd085945d57c2d9a5da745cfb5228c02bc90f2c74bbac746243/pyperclip-1.7.0.tar.gz Building wheels for collected packages: pyperclip Building wheel for pyperclip (setup.py) ... done Stored in directory: C:\Users\rajesh\AppData\Local\pip\Cache\wheels\92\f0\ac\2ba2972034e98971c3654ece337ac61e546bdeb34ca960dc8c Successfully built pyperclip Installing collected packages: pyperclip Successfully installed pyperclip-1.7.0
Steps to accomplish this:
First read the desired address either from the command line argument or from the clipboard.
Second using the webbrowser module to automatically open default web browser with the desired address.
Require sys module to access the command line stored in argv list.
Lastly use pyperclip module to access from the clipboard.
#webbrowser module helps in open default web browser of os from webbrowser import open #sys contains command line arguments from sys import argv #To access clipbord from pyperclip import paste if len(argv)>1: address = " ".join(argv[1:]) else: address = paste() open("http://www.google.com/maps/place/"+address)
- How to show current location on a google map on Android?
- How to show current location on a Google Map on Android using Kotlin?
- Get a google map image of specified location using Google Static Maps API in Python
- How to best display HTML5 geolocation accuracy on a Google Map?
- Plotting Data on Google Map using pygmaps package?
- Why Google embedded Map Makers inside Google Maps?
- Plotting Google Map using gmplot package in Python?
- How to open a file in the same directory as a Python script?
- How to detect touch and its position on Google map in Android?
- Autorun a Python script on windows startup?
- Plotting Google Map using folium package?
- How to run Python code on Google Colaboratory?
- Ok google a google voice search on chrome beta
- How to show current location using HTML5 Geolocation with Google Maps?
- How to execute Python CGI Script on Apache Server?