编写简单GUI程序

import tkinter
from functools import partial

window = tkinter.Tk()

lb = tkinter.Label(window,text='Hello World!',font="Arial,60")
b1 = tkinter.Button(window,fg='white',bg='blue',text='Button 1')
MyButton = partial(tkinter.Button,window,fg='white',bg='blue')
b2 =MyButton(text='Button 2')
b3 = MyButton(text="Quit",command=window.quit)

lb.pack()
b1.pack()
b2.pack()
b3.pack()

window.mainloop()

 

转载于:https://www.cnblogs.com/lsgo/p/10555342.html

你可能感兴趣的:(python)