控制台运行结果
二,界面搭建
======
main包下的main文件
1,新建窗口
# 新建一个窗口
window=Tk()
2,为窗口设置标题
# 设置标题
window.title(‘险种管理’)
3,设置窗口大小
# 设置大小 widthxheightt+x+y
window.geometry(‘400x400+200+200’)
4,编写窗口内容
# 编写控件Treeview
table = Treeview(columns=(‘id’,‘name’,‘money’,‘type’),show=‘headings’)
table.column(‘id’,width=100)
table.column(‘name’,width=100)
table.column(‘money’,width=100)
table.column(‘type’,width=100)
table.heading(‘id’,text=‘记录编号’)
table.heading(‘name’,text=‘缴费者’)
table.heading(‘money’,text=‘缴费金额’)
table.heading(‘type’,text=‘缴费类型’)
5,显示窗口
# 让控件显示
table.pack()
6,运行窗口
# 让窗口运行
window.mainloop()
控制台运行效果