#可以这么用weather=Weather_2345('广州','201811','201901')print(weather.get_weather())#也可以这么用weather=Weather_2345('下面会再次设置区域这里可以随便填','201811','201901')area_list=["白云","从化","花都","海珠","黄埔","荔湾","南沙","番禺","天河","越秀","增城"]withopen('./weather.log','w',encoding='utf-8')asfw:fw.write("区域,日期,最高气温,最低气温,天气,风向,风力,空气指数,空气情况,空气等级"+"\n")forareainarea_list:print()weather.area=areaweather_list=weather.get_weather()forlinesinweather_list:fw.write(",".join(lines)+'\n')
1