[Python Tutorial] pythonGUI programming (Tkinter)

Source: Internet
Author: User
Python provides a library for multiple graphic development interfaces. several commonly used PythonGUI libraries are as follows:

Python GUI Programming (Tkinter)

Python provides a library for multiple graphical development interfaces. several common Python GUI libraries are as follows:

Tkinter: Tkinter module ("Tk interface") is the interface of Python's standard Tk GUI toolkit. tk and Tkinter can be used on most Unix platforms. They can also be used in Windows and Macintosh systems ., later versions of Tk8.0 can implement the local window style and run well on most platforms.

WxPython: wxPython is an open-source software and a set of excellent GUI graphics libraries in Python. It Allows Python programmers to easily create a complete GUI with full function keys.

Jython: the Jython program can be seamlessly integrated with Java. In addition to some standard modules, Jython uses Java modules. Jython has almost all modules that do not depend on C language in standard Python. For example, the Jython user interface uses Swing, AWT, or SWT. Jython can be dynamically or statically compiled into Java bytecode.

Tkinter programming

Tkinter is a standard Python GUI library. Python uses Tkinter to quickly create GUI applications.

Because Tkinter is built into the python installation package, the Tkinter library can be imported After Python is installed, and the IDLE is also compiled by Tkinter, Tkinter can still cope with the simple graphic interface.

Create a GUI program

1. import the Tkinter module

2. create controls

3. specify the master of the control, that is, the master of the control.

4. tell the GM (geometry manager) that a control is generated.

Instance:

#! /Usr/bin/python

Import Tkinter
Top = Tkinter. Tk ()
# Entering the Message loop
Top. mainloop ()

The preceding code execution result is as follows:

The above is the content of the [python Tutorial] python GUI Programming (Tkinter). For more information, see The PHP Chinese network (www.php1.cn )!

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.