Created
September 17, 2016 01:52
-
-
Save dawranliou/363bf8d9631930b143f7cdc011da91f5 to your computer and use it in GitHub Desktop.
The program to check the traffic for my way home
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
#!python | |
import webbrowser | |
import os | |
destination = os.environ.get('HOME_ADDR') | |
destination = '+'.join(destination.split()) | |
origin = os.environ.get('OFFICE_ADDR') | |
origin = '+'.join(origin.split()) | |
url = 'https://www.google.com/maps/dir/%s/%s' % (origin, destination) | |
webbrowser.open(url) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Instruction
export HOME_ADDR="your-home-address"
export OFFICE_ADDR="your-office-address"
chmod +x takemehome.py
./takemehome.py