lsgo

编写简单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()

 

发表于 2019-03-18 21:48  学无牙  阅读(648)  评论(0编辑  收藏  举报
 

分类:

技术点:

相关文章:

  • 2021-04-19
  • 2021-11-17
  • 2022-12-23
  • 2021-11-22
  • 2021-09-14
  • 2021-09-04
  • 2021-12-14
猜你喜欢
  • 2021-11-09
  • 2021-04-21
  • 2021-09-28
  • 2021-04-24
  • 2022-12-23
  • 2021-06-02
  • 2021-08-30
相关资源
相似解决方案