Python simple application programming experience sharing

Source: Internet
Author: User

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:

 
 
  1. From Tkinter import *
  2. From tkMessageBox import *
  3. Def button_click ():
  4. Showinfo ('first application', 'Hello world! ') Root = Tk ()
  5. B = Button (root, text = 'dahuzizyd ', command = button_click)
  6. B. pack (side = TOP)
  7. 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.


 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.