Created
November 27, 2017 14:41
-
-
Save titaneric/cf2c315e36346ac0258fe9b99e8f41c5 to your computer and use it in GitHub Desktop.
To vidmle @ptt-python
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
import json | |
from urllib.request import urlopen | |
with urlopen("http://opendata2.epa.gov.tw/AQI.json") as url: | |
text = url.read().decode("utf8") | |
json_list = json.loads(text) | |
with open("AQI.json", "w", encoding="utf8") as f: | |
json.dump(json_list, f, ensure_ascii=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment