wxPython was born when Robin Dunn needed a GUI to be deployed on HP-UX systems and also on Windows 3.1 in a few weeks time. While evaluating commercial solutions, he ran across Python bindings for the wxWidgets toolkit. Thus, he learned Python and, in a short time, became one of the main developers of wxPython (which grew from those initial bindings), together with Harri Pasanen. The first versions of the wrapper were created by hand. However, soon the code base became very difficult to maintain and keep in sync 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.
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 pythonimport 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 is an effort to make wxPython compatible with Python 3 which began in 2012. 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 GUI on Windows, Macs or Unix systems with a native look and feel and requiring very little (if any) platform specific code.