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 )!