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.

Developer(s)Robin Dunn
Harri Pasanen
Initial release1998 (1998)[1]
Stable release
4.0.6[2] / May 21, 2019 (2019-05-21)
Preview release
4.0.5a1[3] / March 6, 2019 (2019-03-06)
Written inC++ / Python
Operating systemCross-platform
LicensewxWindows License


Being a wrapper, wxPython uses the same free software licence used by wxWidgets (wxWindows License)[4]—which is approved by Free Software Foundation and Open Source Initiative.


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]


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.

Project Phoenix

Project Phoenix, which began in 2010, is an effort to clean up the wxPython implementation and in the process make it compatible with Python 3.[5] 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.[6]

Applications developed with wxPython

See also

  • wxGlade, a wxWidgets GUI designer (look & feel of Glade Interface Designer) that creates wxPython code
  • XRCed, an XML tool for wxPython GUI design (external link)


  1. "wxPython 0.3 announcement on Yahoo Groups". Retrieved 2007-01-16.
  2. "wxPython". Retrieved 2019-04-26.
  3. "Index of /Phoenix/snapshot-builds". Retrieved 2019-04-26.
  4. "Copyright notice". Retrieved 2009-02-27.
  5. "Goals of Project Phoenix". Retrieved 2016-03-17.
  6. "Project Phoenix readme file on GitHub". Retrieved 2014-01-01.
  7. "Open source components and licenses". Google. Retrieved 28 January 2013.
  • Rappin, Noel; Dunn, Robin (March 1, 2006). wxPython in Action. Greenwich: Manning Publications. p. 552. ISBN 978-1-932394-62-7.

Further reading

  • Precord, Cody (December 2010). wxPython 2.8 Application Development Cookbook. Greenwich: Packt Publishing. p. 308. ISBN 978-1-84951-178-0.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.