Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
WxPython
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Python wrapper for wxWidgets}} {{lowercase title|title=wxPython}} {{Infobox software | name = | logo = WxPython-logo.png | logo size = 210px | screenshot = | caption = wxPython | developer = Robin Dunn<br />Harri Pasanen | released = {{Start date and age|1998|df=yes}} | latest release version = 4.2.2<ref>{{Cite web|date=2024-09-11|title=wxPython Changelog|url=https://www.wxpython.org/news/2024-09-11-wxpython-422-release/index.html|access-date=2024-11-28|website=wxPython|language=en}}</ref> | latest release date = {{Start date and age|2024|09|11}} | latest preview version = | latest preview date = | programming language = [[C++]] / [[Python (programming language)|Python]] | operating system = [[Cross-platform]] | genre = | license = [[wxWidgets#License|wxWindows License]] | website = {{URL|http://wxpython.org/}} }} '''wxPython''' is a [[wrapper library|wrapper]] for the [[cross-platform]] [[graphical user interface|GUI]] [[application programming interface|API]] (often referred to as a "[[toolkit]]") [[wxWidgets]] (which is written in [[C++]]) for the [[Python (programming language)|Python programming language]]. It is one of the alternatives to [[Tkinter]]. It is implemented as a Python extension module ([[native code]]). ==History== In 1995, Robin Dunn needed a [[graphical user interface|GUI]] application to be deployed on [[HP-UX]] systems but also run [[Windows 3.1]] within short time frame. He needed a [[Cross-platform software|cross-platform]] solution. While evaluating free and commercial solutions, he ran across [[Python (programming language)|Python]] bindings on the wxWidgets toolkit [[Web page|webpage]] (known as wxWindows at the time). This was Dunn's introduction to Python. Together with Harri Pasanen and Edward Zimmerman he [[Software Developer|developed]] those initial bindings into wxPython 0.2.<ref name=":0">{{Cite web |last=Team |first=The wxPython |date=2017-07-14 |title=wxPython History |url=https://wxpython.org/pages/history/index.html |access-date=2022-06-25 |website=wxPython |language=en}}</ref> 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.<ref>{{Cite web |date=2001-03-12 |title=Yahoo! Groups : python-announce-list Messages :Message 95 of 1083 |url=https://groups.yahoo.com/group/python-announce-list/message/95 |access-date=2022-06-25 |website= |archive-url=https://web.archive.org/web/20010312234326/https://groups.yahoo.com/group/python-announce-list/message/95 |archive-date=12 March 2001 |url-status=dead}}</ref> The first versions of the wrapper were created by hand. However, the [[Source code|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.<ref name=":0" /> === 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.<ref>{{cite web |title=Goals of Project Phoenix |url=http://wiki.wxpython.org/ProjectPhoenix/ProjectGoals |access-date=2016-03-17}}</ref> 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]].<ref>{{cite web |title=Project Phoenix readme file on GitHub |website=[[GitHub]] |url=https://github.com/wxWidgets/Phoenix/blob/master/README.rst |access-date=2014-01-01}}</ref> With the release of 4.0.0a1 wxPython in 2017, the Project Phoenix version became the official version.<ref>{{Cite web |last=Robin |date=2017-04-16 |title=wxPython 4.0.0a1 Release |url=https://wxpython.org/news/wxpython-4.0.0a1-release/index.html |access-date=2022-06-25 |website=wxPython |language=en}}</ref> wxPython 4.x is the current version being developed as of June 2022.<ref>{{Cite web |last=Team |first=The wxPython |date=2020-11-21 |title=wxPython 4.1.1 Released |url=https://wxpython.org/news/2020-11-21-wxpython-411-release/index.html |access-date=2022-06-25 |website=wxPython |language=en}}</ref> == Use == wxPython enables Python to be used for [[Cross-platform software|cross-platform]] [[graphical user interface|GUI]] applications requiring very little, if any, platform-specific code. === Example === This is a simple "[[Hello world program|Hello world]]" module, depicting the creation of the two main [[Object (computer science)|objects]] in wxPython (the main window object and the application object), followed by passing the control to the [[Event-driven programming|event-driven]] system (by calling <code>MainLoop()</code>) which manages the user-interactive part of the program. <syntaxhighlight lang="python"> #!/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() </syntaxhighlight> This is another example of the wxPython Close Button with wxPython GUI display show in Windows 10 operating system.[[File:Close button with wxpython in windows 10.png|thumb|Close button with wxPython shown on Windows 10]] <syntaxhighlight lang="python3"> 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() </syntaxhighlight> ==License== Being a wrapper, wxPython uses the same [[free software license]] used by [[wxWidgets]] ([[wxWidgets#License|wxWindows License]])<ref>{{cite web |title=Copyright notice |url=http://docs.wxwidgets.org/stable/wx_copyrightnotice.html |access-date=2009-02-27 |archive-date=2009-02-16 |archive-url=https://web.archive.org/web/20090216025901/http://docs.wxwidgets.org/stable/wx_copyrightnotice.html |url-status=dead }}</ref>—which is approved by [[Free Software Foundation]] and [[Open Source Initiative]]. == Applications developed with wxPython == * [[Chandler (PIM)|Chandler]], a [[Personal information management|personal information]] manager * [[Dropbox (service)|Dropbox]], [[Desktop environment|desktop]] client for the Dropbox [[Cloud computing|cloud-based]] storage<ref>{{cite web|title=6 lessons from Dropbox one million files saved every 15 minutes|date=14 March 2011 |url=http://highscalability.com/blog/2011/3/14/6-lessons-from-dropbox-one-million-files-saved-every-15-minu.html}}</ref> * [[Editra]], a [[Cross-platform software|multi-platform]] [[text editor]] * [[Google Drive]], desktop client for the Google cloud-based storage system<ref>{{cite web|title=Open source components and licenses|url=https://support.google.com/drive/bin/answer.py?hl=en&answer=1716931&p=settings_licenses|publisher=Google Inc.|access-date=28 January 2013}}</ref> * [[GRASS GIS]], a free, [[open source]] [[Geographic information system|geographical information system]] * [[Métamorphose (renamer)|Métamorphose]], a [[Batch processing|batch]] renamer * [[Phatch]], a photo batch processor * [[PlayOnLinux]] and [[PlayOnMac]], [[Wine (software)|Wine]] front-ends * [[PsychoPy]], experiment creation tool for [[neuroscience]] and [[psychology]] research <!-- Please don't spam this list with applications that aren't notable enough to have Wikipedia articles. --> == References == === Citations === {{Reflist}} === Sources === {{refbegin}} * {{cite book | first1 = Noel | last1 = Rappin | first2 = Robin | last2 = Dunn | title = wxPython in Action | date = March 1, 2006 | publisher = [[Manning Publications]] | location = Greenwich | page = 552 | isbn = 978-1-932394-62-7 }} {{refend}} ==Further reading== *{{cite book | first1 = Cody | last1 = Precord | title = wxPython 2.8 Application Development Cookbook | date = December 2010 | publisher = [[Packt Publishing]] | location = Greenwich | pages = 308 | isbn = 978-1-84951-178-0 }} ==External links== {{Portal|Free and open-source software}} {{Commons category}} * {{Official website|http://wxpython.org/}} *[https://coderslegacy.com/wxpython-tutorial/ wxPython Widget Tutorial Series] * [http://wiki.wxpython.org/ProjectPhoenix Project Phoenix main page] * [http://wiki.wxpython.org/wxPythonPit%20Apps List of applications developed with wxPython] {{wxWidgets}} {{Widget toolkits}} {{DEFAULTSORT:Wxpython}} [[Category:1998 software]] [[Category:Free computer libraries]] [[Category:Python (programming language) libraries]] [[Category:Widget toolkits]] [[Category:WxWidgets]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Cite book
(
edit
)
Template:Cite web
(
edit
)
Template:Commons category
(
edit
)
Template:Infobox
(
edit
)
Template:Infobox software
(
edit
)
Template:Lowercase title
(
edit
)
Template:Main other
(
edit
)
Template:Official website
(
edit
)
Template:Portal
(
edit
)
Template:Refbegin
(
edit
)
Template:Refend
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Sister project
(
edit
)
Template:Template other
(
edit
)
Template:Widget toolkits
(
edit
)
Template:WxWidgets
(
edit
)