xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

  • 大小: 3.36KB
    文件類型: .py
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2021-01-30
  • 語言: Python
  • 標(biāo)簽: 天氣??查詢??

資源簡介

Python 天氣查詢 示例源碼

資源截圖

代碼片段和文件信息

from?tkinter?import?*
import?urllib.request
import?gzip
import?json
from?tkinter?import?messagebox

root?=?Tk()

def?main():
????#輸入窗口
????root.title(‘天氣查詢‘)#窗口標(biāo)題
????Label(roottext?=?‘請輸入城市‘).grid(row=0column=0)#設(shè)置標(biāo)簽并調(diào)整位置
????enter?=?Entry(root)#輸入框
????enter.grid(row?=?0column=1padx?=?20?pady?=?20)#調(diào)整位置
????enter.delete(0END)#清空輸入框
????enter.insert(0‘綿陽‘)#設(shè)置默認(rèn)文本
????#enter_text?=?enter.get()#獲取輸入框的內(nèi)容5
????
????running?=?1

????def?get_weather_data()?:#獲取網(wǎng)站數(shù)據(jù)
????????city_name?=?enter.get()#獲取輸入框的內(nèi)容
????????url1?=?‘http://wthrcdn.etouch.cn/weather_mini?city=‘+urllib.parse.quote(city_name)
????????url2?=?‘http://wthrcdn.etouch.cn/weather_mini?citykey=101010100‘
????????#網(wǎng)址1只需要輸入城市名,網(wǎng)址2需要輸入城市代碼
????????#print(url1)
????????weather_data?=?urllib.request.urlop

評論

共有 條評論