資源簡介
將txt中的數據讀取并存入sqlite中,利用tkinter將數據庫增刪改查界面化,并將數據庫數據顯示至treedata樹結構中,詳情請看博文https://blog.csdn.net/qq_40435493/article/details/103567881
代碼片段和文件信息
import?tkinter?as?tk
from?tkinter?import?*
from?tkinter?import?ttk
import?sqlite3
#窗口
window=tk.Tk()
#?設置窗口大小
winWidth?=?800
winHeight?=?600
#?獲取屏幕分辨率
screenWidth?=?window.winfo_screenwidth()
screenHeight?=?window.winfo_screenheight()
?
x?=?int((screenWidth?-?winWidth)?/?2)
y?=?int((screenHeight?-?winHeight)?/?2)
?
#?設置主窗口標題
window.title(“學生管理數據庫系統“)
#?設置窗口初始位置在屏幕居中
window.geometry(“%sx%s+%s+%s“?%?(winWidth?winHeight?x?y))
#?設置窗口圖標
window.iconbitmap(“./icon.ico“)
#?設置窗口寬高固定
window.resizable(0?0)
#界面分割
frm_root=tk.frame(window)
frm_head=tk.frame(frm_rootheight=50width=800)
frm_infoShow=tk.frame(frm_rootheight=200width=800)
frm_widget=tk.frame(frm_rootheight=300width=800)
frm_head.pack_propagate(0)
frm_infoShow.pack_propagate(0)
frm_widget.pac
評論
共有 條評論