欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

怎么在Python3.7中使用tkinter實(shí)現(xiàn)查詢界面功能-創(chuàng)新互聯(lián)

這篇文章將為大家詳細(xì)講解有關(guān)怎么在Python3.7中使用tkinter實(shí)現(xiàn)查詢界面功能,文章內(nèi)容質(zhì)量較高,因此小編分享給大家做個(gè)參考,希望大家閱讀完這篇文章后對(duì)相關(guān)知識(shí)有一定的了解。

專注于為中小企業(yè)提供成都網(wǎng)站設(shè)計(jì)、網(wǎng)站制作、外貿(mào)營(yíng)銷網(wǎng)站建設(shè)服務(wù),電腦端+手機(jī)端+微信端的三站合一,更高效的管理,為中小企業(yè)龍游免費(fèi)做網(wǎng)站提供優(yōu)質(zhì)的服務(wù)。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動(dòng)了成百上千企業(yè)的穩(wěn)健成長(zhǎng),幫助中小企業(yè)通過(guò)網(wǎng)站建設(shè)實(shí)現(xiàn)規(guī)模擴(kuò)充和轉(zhuǎn)變。

Tkinter 是 Python 的標(biāo)準(zhǔn) GUI 庫(kù)。Python 使用 Tkinter 可以快速的創(chuàng)建 GUI 應(yīng)用程序。

#!/usr/bin/python
# -*- coding: UTF-8 -*-
from tkinter import *
import sqlite3
# 導(dǎo)入消息對(duì)話框子模塊
import tkinter.messagebox
#import urllib
 #創(chuàng)建主窗口
root = Tk()
root.title('球員查詢')
# 設(shè)置窗口大小
root.minsize(500,500)
#定義變量
name = StringVar()
name.set('')
club = StringVar()
club.set('')
nation = StringVar()
nation.set('')
height = StringVar()
height.set('')
position = StringVar()
position.set('')
age = StringVar()
age.set('')
weight = StringVar()
weight.set('')
num = StringVar()
num.set('')
birthday = StringVar()
birthday.set('')
habit = StringVar()
habit.set('')
#name text, club text, nation text, height text, position text, age text, weight text, num text, birthday text, habit text
le_name = Label(root, textvariable = name).place(x = 100, y = 80)  #姓 名
le_club = Label(root, textvariable = club).place(x = 100, y = 110)  #俱樂(lè)部
le_nation = Label(root, textvariable = nation).place(x = 100, y = 140)  #國(guó)籍
le_height = Label(root, textvariable = height).place(x = 100, y = 170)  #身高
le_position = Label(root, textvariable = position).place(x = 100, y = 200)  #位置
le_age = Label(root, textvariable = age).place(x = 100, y = 230)  #年齡
le_weight = Label(root, textvariable = weight).place(x = 100, y = 260)  #體重
le_num = Label(root, textvariable = num).place(x = 100, y = 290)  #出場(chǎng)數(shù)
le_birthday = Label(root, textvariable = birthday).place(x = 100, y = 320)  #生日
le_habit = Label(root, textvariable = habit).place(x = 100, y = 350)  #慣用腳
#查詢按鈕響應(yīng)函數(shù)
def select(root, label):
 sname = label.get()
 print('input: ',sname)
 #查詢剛才插入的數(shù)據(jù)
 #由于剛才已經(jīng)關(guān)閉了數(shù)據(jù)庫(kù)連接,需要重新創(chuàng)建Connection對(duì)象和Cursor對(duì)象
 conn = sqlite3.connect('dongqiudi.db')
 #c = conn.execute('''select * from footballers''')
 #c = conn.execute("select * from footballers where name like?",(sname,))
 print("select * from footballers where name like '%"+sname+"%'")
 c = conn.execute("select * from footballers where name like '%"+sname+"%'")
 #print(c) #<sqlite3.Cursor object at 0x00000000007E25E0>
 list_re = list(c)
 print('result: ', list_re) #[('艾克森', '15', 'ChOxM1xC0BiAe2D7AAAN-qiRteQ443.png')]
 if len(list_re) <= 0:
 tkinter.messagebox.showinfo('提示',sname+'球員不存在,請(qǐng)輸入其他球員姓名!') 
 else:
 print('result_name: ', list_re[0][0])
 #數(shù)據(jù)成功提取出來(lái)了
 #name text, club text, nation text, height text, position text, age text, weight text, num text, birthday text, habit text
 name.set(list_re[0][0])  #姓 名
 club.set(list_re[0][1])  #俱樂(lè)部
 nation.set(list_re[0][2])  #國(guó)籍
 height.set(list_re[0][3])  #身高
 position.set(list_re[0][4])  #位置
 age.set(list_re[0][5])  #年齡
 weight.set(list_re[0][6])  #體重
 num.set(list_re[0][7])  #出場(chǎng)數(shù)
 birthday.set(list_re[0][8])  #生日
 habit.set(list_re[0][9])  #慣用腳
 conn.close()
#定義一個(gè)返回按鈕調(diào)用的返回函數(shù):callback
def exit_program():
 quit()
def main():
 input_name = Label(root, text = '請(qǐng)輸入球員姓名:').place(x = 30, y = 30)
 label = StringVar()
 entry = Entry(root,bg='#ffffff',width=20,textvariable=label).place(x=130,y=30,anchor='nw')
 #按鈕
 select_button = Button(root,bg='white',text='查詢',width=10,height=1,
    command=lambda :select(root, label)).place(x=280,y=26,anchor='nw')
 exit_button = Button(root,bg='white',text='退出',width=10,height=1,
    command=lambda :exit_program()).place(x=380,y=26,anchor='nw')
 #command是Button中的option項(xiàng),可以指定點(diǎn)擊button時(shí)調(diào)用的callback函數(shù)
 #name text, club text, nation text, height text, position text, age text, weight text, num text, birthday text, habit text
 le_name = Label(root, text = '姓 名:').place(x = 40, y = 80)
 le_club = Label(root, text = '俱樂(lè)部:').place(x = 40, y = 110)
 le_naion = Label(root, text = '國(guó) 籍:').place(x = 40, y = 140)
 le_height = Label(root, text = '身 高:').place(x = 40, y = 170)
 le_positon = Label(root, text = '位 置:').place(x = 40, y = 200)
 le_age = Label(root, text = '年 齡:').place(x = 40, y = 230)
 le_weight = Label(root, text = '體 重:').place(x = 40, y = 260)
 le_num = Label(root, text = '號(hào) 碼:').place(x = 40, y = 290)
 le_birthday = Label(root, text = '生 日:').place(x = 40, y = 320)
 le_habit = Label(root, text = '慣用腳:').place(x = 40, y = 350)
 #顯示圖片
 #pilImage = Image.open("imgs/1574777943.3190248.png")
 #tkImage = ImageTk.PhotoImage(image=pilImage)
 #label_nation = Label(root, image=tkImage).place(x=90, y=130, anchor='nw')
 root.mainloop()
main()
Python的優(yōu)點(diǎn)有哪些

1、簡(jiǎn)單易用,與C/C++、Java、C# 等傳統(tǒng)語(yǔ)言相比,Python對(duì)代碼格式的要求沒(méi)有那么嚴(yán)格;2、Python屬于開(kāi)源的,所有人都可以看到源代碼,并且可以被移植在許多平臺(tái)上使用;3、Python面向?qū)ο?,能夠支持面向過(guò)程編程,也支持面向?qū)ο缶幊蹋?、Python是一種解釋性語(yǔ)言,Python寫(xiě)的程序不需要編譯成二進(jìn)制代碼,可以直接從源代碼運(yùn)行程序;5、Python功能強(qiáng)大,擁有的模塊眾多,基本能夠?qū)崿F(xiàn)所有的常見(jiàn)功能。

關(guān)于怎么在Python3.7中使用tkinter實(shí)現(xiàn)查詢界面功能就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,可以學(xué)到更多知識(shí)。如果覺(jué)得文章不錯(cuò),可以把它分享出去讓更多的人看到。

網(wǎng)站題目:怎么在Python3.7中使用tkinter實(shí)現(xiàn)查詢界面功能-創(chuàng)新互聯(lián)
瀏覽地址:http://aaarwkj.com/article8/dihdop.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站制作App設(shè)計(jì)、定制開(kāi)發(fā)微信公眾號(hào)、服務(wù)器托管商城網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

商城網(wǎng)站建設(shè)
欧洲亚洲国产一区二区| av中文字幕一二三区| 秋霞日韩欧美一区二区三区| 国产亚洲精品一区在线| 91精品人妻一区二区三区| 欧美午夜福利在线电影| 久久久久久亚洲精品人妻| 亚洲精品一区av在线观看| 日本福利写真在线观看| 在线观看亚洲毛片网站| 香蕉夜夜草草久久亚洲香蕉| 亚洲国产精品一区二区电影| 男女性情视频免费大全网站| 免费97久久人妻一区精品| 日韩一二三四区精品电影免费播放| 久热伊人精品国产中文| 天堂av在线资源观看| 国产精品成人一区二区艾草| 日韩精品二区在线观看| 亚洲不卡在线免费av| 91午夜福利偷拍视频| 国产成人色污在线观看| 国产亚洲一区二区三区午夜| 亚洲精品网站国产高清| 日韩午夜免费一区二区蜜桃| 成人黄色一级电影免费看| 91精品国产在线观看| 日本岛国大片一区二区在线观看 | 九九视频免费观看5| 免费在线观看福利av| 毛片一区二区三区免费看| 97视频在线中文字幕| av天堂资源地址在线观看| av真人青青小草一区二区欧美| 最新日韩欧美一区二区| 日本加勒比中文在线观看| 日本特黄特色大片免费| 国产精品自拍小视频91| 日日插天天干夜夜操| 欧美日韩在线不卡成人| 国产毛片一区二区在线|