wxPython
![]() |
|
Developer(s) | Robin Dunn Harri Pasanen |
---|---|
Initial release | 1998[1] |
Stable release | 3.0.2.0 / November 28, 2014 |
Preview release | 3.0.3 (Phoenix)[2] |
Development status | Active |
Written in | C++ / Python |
Operating system | Cross-platform |
License | wxWindows License |
Website | wxpython |
wxPython is a wrapper for the cross-platform GUI API (often referred to as a 'toolkit') wxWidgets (which is written in C++) for the Python programming language. It is one of the alternatives to Tkinter, which is bundled with Python. It is implemented as a Python extension module (native code). Other popular alternatives are PyGTK, its successor PyGObject and PyQt. Like wxWidgets, wxPython is free software.
Contents
License
Being a wrapper, wxPython uses the same free software licence used by wxWidgets (wxWindows License)[3]—which is approved by Free Software Foundation and Open Source Initiative.
History
wxPython was created when Robin Dunn needed a GUI to be deployed on HP-UX systems and also on Windows 3.1 within a few weeks. While evaluating commercial solutions, he ran across Python bindings for the wxWidgets toolkit. Thus, he learned Python and, in a short time, together with Harri Pasanen, became one of the main developers of wxPython, which grew from those initial bindings.
The first versions of the wrapper were created by hand. However, soon the code base became very difficult to maintain and keep synchronized with wxWidgets releases. Later versions were created with SWIG, greatly decreasing the amount of work to update the wrapper. The first "modern" version was announced in 1998.[1]
Example
This is a simple "Hello world" module, depicting the creation of the two main objects in wxPython (the main window object and the application object), followed by passing the control to the event-driven system (by calling MainLoop()
) which manages the user-interactive part of the program.
#!/usr/bin/env python
import wx
app = wx.App(False) # Create a new app, don't redirect stdout/stderr to a window.
frame = wx.Frame(None, wx.ID_ANY, "Hello World") # A Frame is a top-level window.
frame.Show(True) # Show the frame.
app.MainLoop()
Project Phoenix
Project Phoenix, which began in 2012, is an effort to make wxPython compatible with Python 3.[4] This project is a new implementation of wxPython, focused on improving speed, maintainability and extensibility. Just like "Classic" wxPython, it wraps the wxWidgets C++ toolkit and provides access to the user interface portions of the wx API, enabling Python applications to have a graphical user interface on Windows, Mac or Unix systems with a native look and feel and requiring very little, if any, platform-specific code.[5]
Applications Developed with wxPython
- BitTorrent, a peer-to-peer BitTorrent application
- Chandler, a Personal Information Manager
- Editra, a multi-platform text editor
- Google Drive, desktop client for the Google cloud-based storage system[6]
- GRASS GIS, a free, open source geographical information system
- Métamorphose, a batch renamer
- Phatch, a Photo Batch Processor
- PlayOnLinux and PlayOnMac, Wine front-ends
See also
- wxGlade, a wxWidgets GUI designer (look & feel of Glade Interface Designer) that creates wxPython code
- wxWidgets, a popular C++ GUI toolkit that wxPython uses as its framework
- XRCed, an XML tool for wxPython GUI design
References
- Notes
<templatestyles src="Reflist/styles.css" />
Cite error: Invalid <references>
tag; parameter "group" is allowed only.
<references />
, or <references group="..." />
- Bibliography
- Lua error in package.lua at line 80: module 'strict' not found.
Further reading
- Lua error in package.lua at line 80: module 'strict' not found.
External links
![]() |
Wikimedia Commons has media related to [[commons:Lua error in Module:WikidataIB at line 506: attempt to index field 'wikibase' (a nil value).|Lua error in Module:WikidataIB at line 506: attempt to index field 'wikibase' (a nil value).]]. |
- Official website
- Project Phoenix main page
- List of applications developed with wxPython
- Tutorial screencasts for starting wxPython programming at showmedo
- ↑ 1.0 1.1 Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.