wxPython
Developer(s) | Robin Dunn Harri Pasanen |
---|---|
Initial release | 1998 |
Stable release | 4.2.1[1]
/ June 7, 2023 |
Repository | |
Written in | Cross-platform |
License | wxWindows License |
Website | wxpython |
wxPython is a
History
In 1995, Robin Dunn needed a
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 "
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.
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
Applications developed with wxPython
- Chandler, a personal informationmanager
- 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
- ^ "wxPython Changelog". wxPython. 2023-06-07. Retrieved 2023-06-30.
- ^ a b Team, The wxPython (2017-07-14). "wxPython History". wxPython. Retrieved 2022-06-25.
- ^ "Yahoo! Groups : python-announce-list Messages :Message 95 of 1083". 2001-03-12. Archived from the original on 12 March 2001. Retrieved 2022-06-25.
- ^ "Goals of Project Phoenix". Retrieved 2016-03-17.
- ^ "Project Phoenix readme file on GitHub". Retrieved 2014-01-01.
- ^ Robin (2017-04-16). "wxPython 4.0.0a1 Release". wxPython. Retrieved 2022-06-25.
- ^ Team, The wxPython (2020-11-21). "wxPython 4.1.1 Released". wxPython. Retrieved 2022-06-25.
- ^ "Copyright notice". Retrieved 2009-02-27.
- ^ "6 lessons from Dropbox one million files saved every 15 minutes".
- ^ "Open source components and licenses". Google. Retrieved 28 January 2013.
Sources
- Rappin, Noel; Dunn, Robin (March 1, 2006). wxPython in Action. Greenwich: ISBN 978-1-932394-62-7.
Further reading
- Precord, Cody (December 2010). wxPython 2.8 Application Development Cookbook. Greenwich: ISBN 978-1-84951-178-0.