Created
January 15, 2021 12:19
-
-
Save tana9/dd3162012734421eec71b4841f62783a to your computer and use it in GitHub Desktop.
This file contains 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
""" | |
Google MapsのdirectionsAPIの結果をJSON形式で保存する | |
""" | |
import json | |
import googlemaps | |
gmaps = googlemaps.Client(key="") | |
result = googlemaps.client.directions(gmaps, language="ja", mode="driving", origin="東京駅", destination="秋葉原駅") | |
print(result) | |
with open("directions.json", "w", encoding="utf8") as f: | |
json.dump(result, f, ensure_ascii=False, indent=2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment