Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

wxPython

From Wikipedia, the free encyclopedia
Python wrapper for wxWidgets
WxPython
DevelopersRobin Dunn
Harri Pasanen
Initial release1998; 28 years ago (1998)
Stable release
4.2.2[1] / September 11, 2024; 17 months ago (2024-09-11)
Written inC++ /Python
Operating systemCross-platform
LicensewxWindows License
Websitewxpython.org
Repository

wxPython is awrapper for thecross-platformGUIAPI (often referred to as a "toolkit")wxWidgets (which is written inC++) for thePython programming language. It is one of the alternatives toTkinter. It is implemented as a Python extension module (native code).

History

[edit]

In 1995, Robin Dunn needed aGUI application to be deployed onHP-UX systems but also runWindows 3.1 within short time frame. He needed across-platform solution. While evaluating free and commercial solutions, he ran acrossPython bindings on the wxWidgets toolkitwebpage (known as wxWindows at the time). This was Dunn's introduction to Python. Together with Harri Pasanen and Edward Zimmerman hedeveloped 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, thecode became difficult to maintain and keep synchronized with wxWidgets releases. By 1997, versions were created withSWIG, greatly decreasing the amount of work to update the wrapper.[2]

Project Phoenix

[edit]

In 2010, the Project Phoenix began; an effort to clean up the wxPythonimplementation 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 wxWidgetsC++ toolkit and provides access to theuser interface portions of the wxWidgetsAPI.[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

[edit]

wxPython enables Python to be used forcross-platformGUI applications requiring very little, if any, platform-specific code.

Example

[edit]

This is a simple "Hello world" module, depicting the creation of the two mainobjects in wxPython (the main window object and the application object), followed by passing the control to theevent-driven system (by callingMainLoop()) which manages the user-interactive part of the program.

#!/usr/bin/env python3importwxapp=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
importwxclassWxButton(wx.Frame):def__init__(self,*args,**kw):super(WxButton,self).__init__(*args,**kw)self.InitUI()defInitUI(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()defOnClose(self,e):self.Close(True)defmain():app=wx.App()ex=WxButton(None)ex.Show()app.MainLoop()if__name__=="__main__":main()

License

[edit]

Being a wrapper, wxPython uses the samefree software license used bywxWidgets (wxWindows License)[8]—which is approved byFree Software Foundation andOpen Source Initiative.

Applications developed with wxPython

[edit]

References

[edit]

Citations

[edit]
  1. ^"wxPython Changelog".wxPython. 2024-09-11. Retrieved2024-11-28.
  2. ^abTeam, The wxPython (2017-07-14)."wxPython History".wxPython. Retrieved2022-06-25.
  3. ^"Yahoo! Groups : python-announce-list Messages :Message 95 of 1083". 2001-03-12. Archived fromthe original on 12 March 2001. Retrieved2022-06-25.
  4. ^"Goals of Project Phoenix". Retrieved2016-03-17.
  5. ^"Project Phoenix readme file on GitHub".GitHub. Retrieved2014-01-01.
  6. ^Robin (2017-04-16)."wxPython 4.0.0a1 Release".wxPython. Retrieved2022-06-25.
  7. ^Team, The wxPython (2020-11-21)."wxPython 4.1.1 Released".wxPython. Retrieved2022-06-25.
  8. ^"Copyright notice". Archived fromthe original on 2009-02-16. Retrieved2009-02-27.
  9. ^"6 lessons from Dropbox one million files saved every 15 minutes". 14 March 2011.
  10. ^"Open source components and licenses". Google Inc. Retrieved28 January 2013.

Sources

[edit]

Further reading

[edit]

External links

[edit]
Wikimedia Commons has media related toWxPython.
Technologies
RAD,GUI
builders
Free software
Proprietary software
Libraries
Bindings
Low-level platform-specific
OnAmigaOS
OnClassic Mac OS,macOS
OnWindows
OnUnix
OnBeOS,Haiku
OnAndroid
CLI
Low Level Cross-platform
CLI
C
Java
High-level, platform-specific
OnAmigaOS
OnClassic Mac OS,macOS
Object Pascal
Objective-C,Swift
C++
CLI
OnWindows
CLI
C++
Object Pascal
OnUnix andX11
High-level, cross-platform
C
C++
Objective-C
CLI
Adobe Flash
Go
Haskell
Java
JavaScript
Common Lisp
Lua
Pascal
Object Pascal
Perl
PHP
Python
Ruby
Tcl
XML
shell
Dart
Retrieved from "https://en.wikipedia.org/w/index.php?title=WxPython&oldid=1269920464"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp