Python uses Easygui to write graphical interface programs

Source: Internet
Author: User
  1. Let's start by downloading a class library Easygui, a class library that Python uses to simply develop a graphical interface, and open the Easygui download page http://sourceforge.net/projects/easygui/?source= Directory, click the Green download button to download it. After download is a suffix named zip file, unzip, and then put the easygui.py in the Python3 installation directory in the Lib folder, such as D:\Python33\Lib

  2. 2

    Next we use Easygui to create a simple message box. Open a text editor at any point (I'm using Gvim, you can use it, and Windows comes with Notepad), enter two lines of code, and save as gui.py

  3. 3

    The first line of code is "import Easygui", that is, import Easygui This module, let Python know that there is such a thing. The second line of code is "Easygui.msgbox (" "Hello World"), create a Easygui message box, the message is "Hello World", this content can be arbitrarily determined (if the content is Chinese, message box display will be garbled, The following experience tells you Easygui how to use Chinese). Next double-click on the gui.py file, then we will see a message box with "OK" button, "Hello World", press "OK" button, the message box disappears.

Python uses Easygui to write graphical interface programs

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.