python中使用tkinter模块创建gui程序实例.docVIP

  • 9
  • 0
  • 约6.74千字
  • 约 10页
  • 2021-12-04 发布于浙江
  • 举报

python中使用tkinter模块创建gui程序实例.doc

python中使用tkinter模块创建gui程序实例 Python中使用Tkinter模块创建GUI程序实例 使用Tkinter模块来创建简单的GUI程序。 Tkinter的Widgets有:Button、Canvas、Checkbutton、Entry、Frame、Label、Listbox、Menu、Menubutton、Message、Radiobutton、Scales、Scrollbar、TEXT、Toplevel等。 例: 代码如下: # This program displays an empty window. import Tkinter def main(): main_window = Tkinter.Tk() Tkinter.mainloop() main() 例2: 代码如下: import Tkinter class MyGUI: def __init__(self): # Create the main window widget. self.main_window = Tkinter.Tk() # Enter the Tkinter main loop. Tkinter.mainloop() # Create an instance of the MyGUI class. my_gui = MyGUI() 例3:

文档评论(0)

1亿VIP精品文档

相关文档