五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

可以用的天氣

2023-05-27 18:03 作者:Bin不是冰  | 我要投稿

import requests

import json

import os

import pickle

if not os.path.exists("first_time.pickle"):
? ?key = input("請(qǐng)輸入和風(fēng)天氣key:")
? ?with open("first_time.pickle", "wb") as f:
? ? ? ?pickle.dump(key, f)
else:
? ?with open("first_time.pickle", "rb") as f:
? ? ? ?key = pickle.load(f)

city = input("請(qǐng)輸入你想查詢的城市名稱:")

url = "https://geoapi.qweather.com/v2/city/lookup"

querystring = {"location":city,"key":key}

headers = {
? ?"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"}

response = requests.request("GET", url, headers=headers, params=querystring)

if "location" in response.json():
? ?city_id = response.json()["location"][0]["id"]
else:
? ?print("獲取城市ID失敗,請(qǐng)檢查你的請(qǐng)求參數(shù)和API Key是否正確。")
? ?exit()

url = "https://devapi.qweather.com/v7/weather/now"

querystring = {"location":city_id,"key":key}

response = requests.request("GET", url, headers=headers, params=querystring)

response = requests.request("GET", url, headers=headers, params=querystring)

data = json.loads(response.text)
code = data["code"]
update_time = data["updateTime"]
fx_link = data["fxLink"]
now_data = data["now"]
obs_time = now_data["obsTime"]
temp = now_data["temp"]
feels_like = now_data["feelsLike"]
icon = now_data["icon"]
text = now_data["text"]
wind360 = now_data["wind360"]
wind_dir = now_data["windDir"]
wind_scale = now_data["windScale"]
wind_speed = now_data["windSpeed"]
humidity = now_data["humidity"]
precip = now_data["precip"]
pressure = now_data["pressure"]
vis = now_data["vis"]
cloud = now_data["cloud"]
dew = now_data["dew"]

print("網(wǎng)頁視圖鏈接",fx_link)
print("天氣更新時(shí)間",obs_time)
print("當(dāng)前溫度為",temp,"℃")
print("體感溫度",feels_like,"℃")
print("天氣狀況",text)
print("風(fēng)向360角度",wind360,"°")
print("風(fēng)向",wind_dir)
print("風(fēng)力等級(jí)",wind_scale)
print("風(fēng)速",wind_speed,"公里/小時(shí)")
print("相對(duì)濕度",humidity,"%")
print("當(dāng)前小時(shí)累計(jì)降水量",precip,"毫米")
print("大氣壓強(qiáng)",pressure,"百帕")
print("能見度",vis,"公里")
print("云量",cloud,"%")
print("露點(diǎn)濕度",dew)


可以用的天氣的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國家法律
扎鲁特旗| 云霄县| 政和县| 富阳市| 凤冈县| 鲁山县| 南投县| 张北县| 枞阳县| 双城市| 靖边县| 通榆县| 西吉县| 建阳市| 贵定县| 玉龙| 长泰县| 红河县| 漳浦县| 扎囊县| 平湖市| 漠河县| 上犹县| 怀来县| 苏尼特左旗| 东乌| 孟村| 宣城市| 和龙市| 阜城县| 巴林左旗| 新泰市| 肃宁县| 茂名市| 宝清县| 襄垣县| 奇台县| 安多县| 盐津县| 大关县| 义马市|