There are many interesting small programs in python simple application process. In this example, a simple Hello World is a typical example. Python uses the Tkinter module to implement the basic GUI, such as button and Label. Below is a simple Hello World Program, which uses python2.4
The content of the py file is as follows:
- From Tkinter import *
- From tkMessageBox import *
- Def button_click ():
- Showinfo ('first application', 'Hello world! ') Root = Tk ()
- B = Button (root, text = 'dahuzizyd ', command = button_click)
- B. pack (side = TOP)
- Root. mainloop ()
In idle, press F5 to execute. A window is displayed.
If you use the command line method, after you write root = Tk (), you will see a window. Then, every time you write a sentence, it will be directly reflected in the window. Simple python applications require constant research. such interesting things are worth exploring.