10-1python之窗体 窗体的设计是python重要功能之一可以通过这种设计实现用户信息的采集是极为实用的装置。引用tkinter库先用title命名而后用config设置背景颜色geometry调长宽icon设置左上角图标label设定中间标签与具体输入内容最后用entry表示输入。fromtkinterimport*rootTk()root.title(tkinter案例——窗口)#root.update()root.geometry(450x300)root.update()#root.config(background#6fb765)root.attributes(-topmost,True)root.attributes(-alpha,1)root.iconbitmap(logo.ICO)labelLabel(root,text欢迎学习Tkinter,font(楷体,20),bg#7CCD7C,width30,height5,padx10,pady15,borderwidth10,reliefsunken)#label.pack()root.resizable(0,0)label1Label(root,text账号:)label2Label(root,text密码:)label1.grid(row0)label2.grid(row1)entry1Entry(root)entry2Entry(root)entry1.grid(row0,column1)entry2.grid(row1,column1)textText(root,width50,height30,undoTrue,autoseparatorsFalse)text.insert(INSERT,敦品励学严谨求是)text.grid(row2,column0)#text.pack()root.mainloop()