在将我从api读取的数据保存为csv格式时,我无法将其导出
import requests
import csv
api_address='http://api.openweathermap.org/data/2.5/weather?appid=c813d30c0e935c06d54403f3b77bb104&q='
city = input('City Name :')
url = api_address + city
json_data = requests.get(url).json()
with open('people.csv','w') as csvfile:
writer = csv.writer(csvfile)
for item in json_data:
writer.writerow(item)