Python version of Hello World

xiaoxiao2021-03-06  41

Python uses the Tkinter module to achieve basic GUI, such as Button, Label, etc., the following is a simple Hello Wrold program, using the python2.4 .py file content as follows: from tkinter import * from TkMessageBox import *

DEF button_Click (): showinfo ('first application ") root = tk () b = button (root, text =' dahuzizyd ', command = button_click) b.Pack (Side = TOP) root.mainloop () Press F5 in the idle to see a window. If you use the command line mode, then you will see a window after you write the root = tk (), then you will write directly on the window. Python is really a fun Dongdong

转载请注明原文地址:https://www.9cbs.com/read-51052.html

New Post(0)