Programs Using Wxwidgets Python

Wxwidgets Demo

This topic was written by Robin Dunn, author of the wrapper. What is wxPython? WxPython is a blending of the wxWidgets GUI classes and the Python programming language. Python So what is Python? Go to to learn more, but in a nutshell Python is an interpreted, interactive, object-oriented programming language. It is often compared to Tcl, Perl, Scheme or Java.

Python combines remarkable power with very clear syntax. It has modules, classes, exceptions, very high level dynamic data types, and dynamic typing.

There are interfaces to many system calls and libraries, and new built-in modules are easily written in C or C++. Python is also usable as an extension language for applications that need a programmable interface. Python is copyrighted but freely usable and distributable, even for commercial use. WxPython wxPython is a Python package that can be imported at runtime that includes a collection of Python modules and an extension module (native code). It provides a series of Python classes that mirror (or shadow) many of the wxWidgets GUI classes. This extension module attempts to mirror the class hierarchy of wxWidgets as closely as possible.

This means that there is a class in wxPython that looks, smells, tastes and acts almost the same as the class in the C++ version. WxPython is very versatile. It can be used to create standalone GUI applications, or in situations where Python is embedded in a C++ application as an internal scripting or macro language. Currently wxPython is available for Win32 platforms and the GTK toolkit (wxGTK) on most Unix/X-windows platforms. Install Modem Ubuntu here. See the wxPython website for details about getting wxPython working for you.

Jan 23, 2015 - wxPython GUI The wxPython module can be used to create a graphical application (GUI) that looks like a native application on any operating system including Windows, Mac OS. First download and install WxPython, the Python bindings for wxWidgets. Creating our first GUI with Python and wxWidgets.

Why Use wxPython? So why would you want to use wxPython over just C++ and wxWidgets? Personally I prefer using Python for everything. I only use C++ when I absolutely have to eke more performance out of an algorithm, and even then I usually code it as an extension module and leave the majority of the program in Python. Another good thing to use wxPython for is quick prototyping of your wxWidgets apps. With C++ you have to continuously go though the edit-compile-link-run cycle, which can be quite time consuming. With Python it is only an edit-run cycle.

You can easily build an application in a few hours with Python that would normally take a few days or longer with C++. Converting a wxPython app to a C++/wxWidgets app should be a straight forward task.

Other Python GUIs There are other GUI solutions out there for Python. Tkinter Tkinter is the de facto standard GUI for Python. It is available on nearly every platform that Python and Tcl/TK are. Well because Tkinter is just a wrapper around Tcl's GUI toolkit, Tk. This has its upsides and its downsides.

The upside is that Tk is a pretty versatile toolkit. It can be made to do a lot of things in a lot of different environments. It is fairly easy to create new widgets and use them interchangeably in your programs. The downside is Tcl.

Event Program Templates Indesign Cs4. When using Tkinter you actually have two separate language interpreters running, the Python interpreter and the Tcl interpreter for the GUI. Since the guts of Tcl is mostly about string processing, it is fairly slow as well. (Not too bad on a fast Pentium II, but you really notice the difference on slower machines.) It wasn't until the latest version of Tcl/Tk that native Look and Feel was possible on non-Motif platforms. This is because Tk usually implements its own widgets (controls) even when there are native controls available.

Comments are closed.