Examples of Python tkinter use-button

Source: Internet
Author: User

Tkinter is used to write GUI interfaces, Python3 is already included and used directly.
1 #Gui:tkinter Use Example2 ImportTkinter3 4 #instantiating a Tkinter object5top =Tkinter. Tk ()6Top.geometry ('220x60')#Set Window Size7Top.title ('Tkinter Use Example')#Set Window caption8 9 #creates a new Label control object that displays "Hello World"Tenlabel = Tkinter. Label (Top, text='Hello World') One #load a Label control A Label.pack () -  - #New Button control theQUIT_BTN = Tkinter. Button (Top, text='quit', Command=top.quit, bg='Red', fg=' White') - #Set button to fill all horizontal spaces -Quit_btn.pack (Fill=tkinter. X, expand=1) -  + #Loop Run -Tkinter.mainloop ()

Examples of Python tkinter use-button

Related Article

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.