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 and PyQt. Like wxWidgets, wxPython is free software.
License
Being a wrapper, wxPython uses the same free software licence used by wxWidgets (wxWindows License)[1]—which is approved by Free Software Foundation and Open Source Initiative.
History
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.[2]
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
class TestFrame(wx.Frame):
def __init__(self, parent, title):
wx.Frame.__init__(self, parent, wx.ID_ANY, title=title)
text = wx.StaticText(self, label="Hello, world!")
app = wx.App(redirect=False)
frame = TestFrame(None, "Hello, world!")
frame.Show()
app.MainLoop()
Applications Developed with wxPython
- BitTorrent, a peer-to-peer Bit Torrent application
- Chandler, a Personal Information Manger
- Dropbox, a storage provider/file synchroniser
- Phatch, a Photo Batch Processor
- Métamorphose - A batch renamer
- TaskCoach, a Personal Information Manager
- Editra, multi-platform text editor
- Songpress, an application to generate guitar songbooks
- Ulipad, programmer-oriented text editor
- Whyteboard, free whiteboard and PDF annotator
- Wrye Bash, a program for managing The Elder Scrolls IV: Oblivion "mods" and other related content
- Digsby, All in one Instant messaging program.
- pyMorinus, free astrology software using the Swiss Ephemeris
- SOFA Statistics, a free statistics, analysis, & reporting program
- Yet An Other Hex Editor, Arbitrary file size Hex Editor
- GRASS GIS, a free, open source geographical information system
See also
- wxGlade, a wxWidgets GUI 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
- Bibliography
- Rappin, Noel; Dunn, Robin (March 1, 2006). wxPython in Action. Greenwich: Manning Publications. pp. 552. ISBN 978-1932394627.
Further reading
- Precord, Cody (December 2010). wxPython 2.8 Application Development Cookbook. Greenwich: Packt Publishing. pp. 308. ISBN 978-1849511780.
External links
|
|
Low-level |
|
|
High-level |
|
|
|
|
|
|
|
|
|
|
|
|
Cross-platform,
by language
|
|
|
|
XML
|
|
|
|
|
|
|
|
|
C or C++
|
|
|
Common Lisp
|
|
|
Object Pascal
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|