WxPython

Developer(s)| Robin Dunn
Harri Pasanen
Initial release| 1998; 28 years ago (1998)
Stable release|

4.2.2[1] / September 11, 2024; 19 months ago (2024-09-11)

Written in| C++ / Python
Operating system| Cross-platform
License| wxWindows License
Website| wxpython.org

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. It is implemented as a Python extension module (native code).

## Contents

* 1 History
* 1.1 Project Phoenix
* 2 Use
* 2.1 Example
* 3 License
* 4 Applications developed with wxPython
* 5 References
* 5.1 Citations
* 5.2 Sources
* 6 Further reading
* 7 External links

## History

In 1995, Robin Dunn needed a GUI application to be deployed on HP-UX systems but also run Windows 3.1 within short time frame. He needed a cross-platform solution. While evaluating free and commercial solutions, he ran across Python bindings on the wxWidgets toolkit webpage (known as wxWindows at the time). This was Dunn's introduction to Python. Together with Harri Pasanen and Edward Zimmerman he developed those initial bindings into wxPython 0.2.[2]

In August 1998, version 0.3 of wxPython was released. It was built for wxWidgets 2.0 and ran on Win32, with a wxGTK version in the works.[3]

The first versions of the wrapper were created by hand. However, the code became difficult to maintain and keep synchronized with wxWidgets releases. By 1997, versions were created with SWIG, greatly decreasing the amount of work to update the wrapper.[2]

### Project Phoenix

In 2010, the Project Phoenix began; an effort to clean up the wxPython implementation and in the process make it compatible with Python 3.[4] The project is a new implementation of wxPython, focused on improving speed, maintainability and extensibility. Like the previous version of wxPython, it wraps the wxWidgets C++ toolkit and provides access to the user interface portions of the wxWidgets API.[5]

With the release of 4.0.0a1 wxPython in 2017, the Project Phoenix version became the official version.[6] wxPython 4.x is the current version being developed as of June 2022.[7]

## Use

wxPython enables Python to be used for cross-platform GUI applications requiring very little, if any, platform-specific code.

### 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 python3

import wx

app = wx.App(False)  # Create a new app, don't redirect stdout/stderr to a window.
frame = wx.Frame(None, title="Hello World") # A Frame is a top-level window.
frame.Show(True)     # Show the frame.
app.MainLoop()

This is another example of the wxPython Close Button with wxPython GUI display show in Windows 10 operating system.

Close button with wxPython shown on Windows 10

import wx

class WxButton(wx.Frame):

def __init__(self, *args, **kw):
super(WxButton, self).__init__(*args, **kw)
self.InitUI()

def InitUI(self):
pnl = wx.Panel(self)
closeButton = wx.Button(pnl, label='Close Me', pos=(20, 20))

closeButton.Bind(wx.EVT_BUTTON, self.OnClose)

self.SetSize((350, 250))
self.SetTitle('Close Button')
self.Centre()

def OnClose(self, e):
self.Close(True)

def main():
app = wx.App()
ex = WxButton(None)
ex.Show()
app.MainLoop()

if __name__ == "__main__":
main()

## License

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

## Applications developed with wxPython

* Chandler, a personal information manager
* Dropbox, desktop client for the Dropbox cloud-based storage[9]
* Editra, a multi-platform text editor
* Google Drive, desktop client for the Google cloud-based storage system[10]
* 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
* PsychoPy, experiment creation tool for neuroscience and psychology research

## References

### Citations

1. ↑ "wxPython Changelog" (in en). 2024-09-11. https://www.wxpython.org/news/2024-09-11-wxpython-422-release/index.html.
2. ↑ 2.0 2.1 Team, The wxPython (2017-07-14). "wxPython History" (in en). https://wxpython.org/pages/history/index.html.
3. ↑ "Yahoo! Groups : python-announce-list Messages :Message 95 of 1083". 2001-03-12. https://groups.yahoo.com/group/python-announce-list/message/95.
4. ↑ "Goals of Project Phoenix". http://wiki.wxpython.org/ProjectPhoenix/ProjectGoals.
5. ↑ "Project Phoenix readme file on GitHub". https://github.com/wxWidgets/Phoenix/blob/master/README.rst.
6. ↑ Robin (2017-04-16). "wxPython 4.0.0a1 Release" (in en). https://wxpython.org/news/wxpython-4.0.0a1-release/index.html.
7. ↑ Team, The wxPython (2020-11-21). "wxPython 4.1.1 Released" (in en). https://wxpython.org/news/2020-11-21-wxpython-411-release/index.html.
8. ↑ "Copyright notice". http://docs.wxwidgets.org/stable/wx_copyrightnotice.html.
9. ↑ "6 lessons from Dropbox one million files saved every 15 minutes". 14 March 2011. http://highscalability.com/blog/2011/3/14/6-lessons-from-dropbox-one-million-files-saved-every-15-minu.html.
10. ↑ "Open source components and licenses". Google Inc.. https://support.google.com/drive/bin/answer.py?hl=en&answer=1716931&p=settings_licenses.

### Sources

* 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. pp. 308. ISBN 978-1-84951-178-0.

## External links

* Official website
* wxPython Widget Tutorial Series
* Project Phoenix main page
* List of applications developed with wxPython

* v
* t
* e

wxWidgets

Technologies|

* XML Resource

RAD/GUI
Builders|

| free software|

* wxFormBuilder
* wxDev-C++
* Code
* wxGlade
* CodeDesigner RAD
* CodeLite
* Padre
* HiAsm

|

proprietary software|

* wxDesigner
* DialogBlocks

Libraries|

* wxSQLite3

Bindings|

* wxPython
* wxPerl
* wxPHP
* wxBasic
* wxHaskell
* GLUEscript

* v
* t
* e

List of widget toolkits

Low-level|

| On AmigaOS|

* Intuition

|

On Classic Mac OS,
macOS|

| Unknown, native|

* Macintosh Toolbox

|

* Carbon

On Windows|

* Windows API

On Unix,
under X11|

* Xlib
* XCB
* X Toolkit Intrinsics, Xt, X-Toolkit

On BeOS, Haiku|

* BeOS, ZETA, Haiku

On cross-platform|

| CLI|

* OpenTK

|

* GDK
* SDL

Java|

* JOGL

On Android|

| CLI|

* Xamarin.Android

|

High-level|

| On AmigaOS|

* BOOPSI
* MUI
* ReAction GUI
* Zune

|

On Classic Mac OS,
macOS|

| Object Pascal|

* MacApp (v1, v2)

|

Objective-C,
Swift|

| Desktop|

* Cocoa

|

Mobile|

* Cocoa Touch

C++|

* MacApp (v3)
* PowerPlant
* THINK Class Library

CLI|

| Desktop|

* Xamarin.Mac

|

Mobile|

* Xamarin.iOS

On Windows|

| CLI|

| Desktop|

* Windows Forms
* XAML (Silverlight, WinRT XAML, WPF)
* XNA Framework

|

Web|

* XAML (Silverlight)

Mobile|

* XNA Framework

C++|

* MFC
* ATL
* WTL
* OWL

Object Pascal|

* VCL

On Unix,
under X11|

* Athena (Xaw)
* LessTif
* Motif
* OLIT
* XForms

On Android|

| C++|

* Qt for Android

|

Cross-platform,
by language|

| C|

* GTK
* IUP
* Tk
* wxC
* XForms
* XVT

|

C++|

* CEGUI
* CLX
* FLTK
* FOX toolkit
* GLUI
* Gtkmm
* JUCE
* Nana
* Qt
* Rogue Wave Views
* TnFOX
* Ultimate++
* VCF
* Wt
* wxWidgets
* YAAF
* SFML

Objective-C|

* GNUstep

CLI|

| Desktop|

* Gtk#
* Tao (OpenTK, TaoClassic)
* wx.NET
* UIML.NET
* MonoGame

|

Web|

* Moonlight

Mobile|

* MonoGame
* Xamarin.Forms

* DFL
* DlangUI
* DWT
* GtkD
* QtD
* wxD

Flash|

* Apache Flex (MXML)

Haskell|

* Gtk2Hs
* wxHaskell

Java|

| Desktop|

* AWT
* FXML (JavaFX)
* Qt Jambi
* Swing
* SWT
* wx4j
* jUIML

|

Web|

* GWT
* FXML (JavaFX)

Mobile|

* LWUIT

JavaScript|

* Dojo Toolkit
* Echo
* Ext JS
* Google Closure
* jQuery UI
* Qooxdoo
* YUI

Common Lisp|

* CAPI
* CLIM
* Common Graphics
* Ltk
* McCLIM

Lua|

* IUP
* wxLua

Pascal|

| Desktop|

* LCL

|

Mobile|

* LCL

Object Pascal|

| Desktop|

* CLX
* fpGUI
* IP Pascal
* LCL

|

Mobile|

* LCL

Perl|

* Perl/Tk
* wxPerl

PHP|

* PHP-GTK
* PHP-Qt
* wxPHP

Python|

* PyGObject
* PyGTK
* Pyjs
* PyQt
* PySide
* Tkinter
* wxPython

Ruby|

* Shoes
* FXRuby
* Ruby-GNOME2
* qtbindings
* QtRuby
* wxRuby

Tcl|

* Tcl/Tk

XML|

* GladeXML
* Lively Kernel
* Pyjs
* Rialto Toolkit
* XAML
* XUL
* UXP
* Wt

shell|

* whiptail
* dialog

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/WxPython. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Software:WxPython&oldid=4140325"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template