Python历史天气数据API:wunderground

时间:2015-12-20 16:32:10

标签: python ipython wunderground

我正在尝试使用wunderground pythonn API提取历史天气数据,但是我反复收到错误。有人可以帮帮忙:

import requests
def get_precip(gooddate):
urlstart = 'http://api.wunderground.com/api/INSERT_KEY_HERE/history_'
urlend = '/q/Switzerland/Zurich.json'

url = urlstart + str(gooddate) + urlend
data = requests.get(url).json()
for summary in data['history']['dailysummary']:
    print ','.join((gooddate,summary['date']['year'],summary['date']['mon'],summary['date']['mday'],summary['precipm'], summary['maxtempm'], summary['meantempm'],summary['mintempm']))
  

文件“”,第9行       print','。join((gooddate,summary ['date'] ['year'],summary ['date'] ['mon'],summary ['date'] ['mday'],summary ['hillsm '],' maxtempm”,摘要[ 'meantempm'],摘要[ 'mintempm']))               ^   SyntaxError:语法无效

0 个答案:

没有答案