WxPython


wxPython is a wrapper for the cross-platform GUI API wxWidgets for the Python programming language. It is one of the alternatives to Tkinter. It is implemented as a Python extension module.

License

Being a wrapper, wxPython uses the same free software licence used by wxWidgets —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.

Example

This is a simple "Hello world" module, depicting the creation of the two main objects in wxPython, followed by passing the control to the event-driven system which manages the user-interactive part of the program.

  1. !/usr/bin/env python
import wx
app = wx.App # Create a new app, don't redirect stdout/stderr to a window.
frame = wx.Frame # A Frame is a top-level window.
frame.Show # Show the frame.
app.MainLoop

This is another example of wxpython Close Button with wxpython GUI display show in windows 10 operation system.

import wx
class wxbutton:
def __init__:
super.__init__
self.InitUI
def InitUI:
pnl = wx.Panel
closeButton = wx.Button
closeButton.Bind
self.SetSize)
self.SetTitle
self.Centre
def OnClose:
self.Close
def main:
app = wx.App
ex = wxbutton
ex.Show
app.MainLoop
if __name__ '__main__':
main

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. 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.

Applications developed with wxPython