Bob Savage <firstname.lastname@example.org>
A2A I can’t say there’s a best one, as there are so many and they run from lightweight (Tkinter) to enterprise-ready (PyQt) and mobile-oriented (Kivy). I’d recommend trying Tkinter first to see if it provides what you need. If not, then look at wx. Getting Started With wxPython#. The wxPython GUI toolkit is a Python wrapper around a C library called wxWidgets.The initial release of wxPython was in 1998, so wxPython has been around quite a long time. WxPython’s primary difference from other toolkits, such as PyQt or Tkinter, is that wxPython uses the actual widgets on the native platform whenever possible. Try it with Tkinter instead of tkinter - if that works, your IDE is somehow configured to use Python 2 instead of 3. – jasonharper May 8 '19 at 12:24 @jasonharper - Thank you very much for your reply. 1.4 GUI Programming on the Mac. There are several options for building GUI applications on the Mac with Python. PyObjC is a Python binding to Apple's Objective-C/Cocoa framework, which is the foundation of most modern Mac development.
Python on a Macintosh running Mac OS X is in principle very similar to Python onany other Unix platform, but there are a number of additional features such asthe IDE and the Package Manager that are worth pointing out.
4.1. Getting and Installing MacPython¶
Mac OS X 10.8 comes with Python 2.7 pre-installed by Apple. If you wish, youare invited to install the most recent version of Python 3 from the Pythonwebsite (https://www.python.org). A current “universal binary” build of Python,which runs natively on the Mac’s new Intel and legacy PPC CPU’s, is availablethere.
Idle Python Mac
What you get after installing is a number of things:
Python3.9 folder in your
Applications folder. In hereyou find IDLE, the development environment that is a standard part of officialPython distributions; and PythonLauncher, which handles double-clicking Pythonscripts from the Finder.
/Library/Frameworks/Python.framework, which includes thePython executable and libraries. The installer adds this location to your shellpath. To uninstall MacPython, you can simply remove these three things. Asymlink to the Python executable is placed in /usr/local/bin/.
The Apple-provided build of Python is installed in
/usr/bin/python,respectively. You should never modify or delete these, as they areApple-controlled and are used by Apple- or third-party software. Remember thatif you choose to install a newer Python version from python.org, you will havetwo different but functional Python installations on your computer, so it willbe important that your paths and usages are consistent with what you want to do.
IDLE includes a help menu that allows you to access Python documentation. If youare completely new to Python you should start reading the tutorial introductionin that document.
If you are familiar with Python on other Unix platforms you should read thesection on running Python scripts from the Unix shell.
4.1.1. How to run a Python script¶
Your best way to get started with Python on Mac OS X is through the IDLEintegrated development environment, see section The IDE and use the Help menuwhen the IDE is running.
If you want to run Python scripts from the Terminal window command line or fromthe Finder you first need an editor to create your script. Mac OS X comes with anumber of standard Unix command line editors, vim andemacs among them. If you want a more Mac-like editor,BBEdit or TextWrangler from Bare Bones Software (seehttp://www.barebones.com/products/bbedit/index.html) are good choices, as isTextMate (see https://macromates.com/). Other editors includeGvim (http://macvim-dev.github.io/macvim/) and Aquamacs(http://aquamacs.org/).
To run your script from the Terminal window you must make sure that
/usr/local/bin is in your shell search path.
To run your script from the Finder you have two options:
Drag it to PythonLauncher
Select PythonLauncher as the default application to open yourscript (or any .py script) through the finder Info window and double-click it.PythonLauncher has various preferences to control how your script islaunched. Option-dragging allows you to change these for one invocation, or useits Preferences menu to change things globally.
4.1.2. Running scripts with a GUI¶
With older versions of Python, there is one Mac OS X quirk that you need to beaware of: programs that talk to the Aqua window manager (in other words,anything that has a GUI) need to be run in a special way. Use pythonwinstead of python to start such scripts.
With Python 3.9, you can use either python or pythonw.
Python on OS X honors all standard Unix environment variables such as
PYTHONPATH, but setting these variables for programs started from theFinder is non-standard as the Finder does not read your
.cshrc at startup. You need to create a file
~/.MacOSX/environment.plist. See Apple’s Technical Document QA1067 fordetails.
For more information on installation Python packages in MacPython, see sectionInstalling Additional Python Packages.
4.2. The IDE¶
MacPython ships with the standard IDLE development environment. A goodintroduction to using IDLE can be found athttp://www.hashcollision.org/hkn/python/idle_intro/index.html.
4.3. Installing Additional Python Packages¶
There are several methods to install additional Python packages:
Packages can be installed via the standard Python distutils mode (
Many packages can also be installed via the setuptools extensionor pip wrapper, see https://pip.pypa.io/.
4.4. GUI Programming on the Mac¶
There are several options for building GUI applications on the Mac with Python.
PyObjC is a Python binding to Apple’s Objective-C/Cocoa framework, which isthe foundation of most modern Mac development. Information on PyObjC isavailable from https://pypi.org/project/pyobjc/.
The standard Python GUI toolkit is
tkinter, based on the cross-platformTk toolkit (https://www.tcl.tk). An Aqua-native version of Tk is bundled with OSX by Apple, and the latest version can be downloaded and installed fromhttps://www.activestate.com; it can also be built from source.
wxPython is another popular cross-platform GUI toolkit that runs natively onMac OS X. Packages and documentation are available from https://www.wxpython.org.
PyQt is another popular cross-platform GUI toolkit that runs natively on MacOS X. More information can be found athttps://riverbankcomputing.com/software/pyqt/intro.
4.5. Distributing Python Applications on the Mac¶
The standard tool for deploying standalone Python applications on the Mac ispy2app. More information on installing and using py2app can be foundat http://undefined.org/python/#py2app.
4.6. Other Resources¶
The MacPython mailing list is an excellent support resource for Python users anddevelopers on the Mac:
Another useful resource is the MacPython wiki:
Python has a huge number of GUI frameworks (or toolkits) available for it, from TkInter (traditionally bundled with Python, using Tk) to a number of other cross-platform solutions, as well as bindings to platform-specific (also known as 'native') technologies.
Latest update date
All major Web Browsers
All major Web Browsers
The major cross-platform technologies upon which Python frameworks are based include Gtk, Qt, Tk and wxWidgets, although many other technologies provide actively maintained Python bindings.
Windows, MacOS, Linux
Simple & intuitive wrapper for Tkinter. In active development, designed for educational purposes, heavily documented & feature rich!
Linux / many
Fully automatic, live connection among graphical interface widgets and application variables.
Windows, MacOS, Linux
Python bindings for the CEF Framework. CEF is based on Google Chromium and focuses on facilitating embedded browser use cases in third-party applications. With CEF you can create a light-weight native “shell” application that hosts a user interface developed primarily using Web technologies. Examples of embedding CEF browser control are available for many popular GUI toolkits such as PyQt, PySide, wxPython, PyGTK, PyGObject, Kivy and PyGame/PyOpenGL.
Dabo is a 3-tier, cross-platform application development framework, written in Python atop the wxPython GUI toolkit
Windows, MacOS, Linux
DearPyGui A GPU Accelerated Python GUI Framework. At its' core it is a Python implementation of DearImGui. Docs are located on the Github Pages.
A tiny Python module for creating form dialogs/widgets to edit various type of parameters with having to write any GUI code
Based on the Qt Python binding module PyQt4, guidata is a Python library generating graphical user interfaces for easy dataset editing and display. It also provides helpers and application development tools for PyQt4.
A Qt wrapper that makes it extremely easy to create simple graphical interfaces
Converts most argparse based CLI programs into wxPythonGUI programs with a single import and decorator.
Windows, MacOS, Linux (Tkinter based)
The aim of guizero is to make the process of creating simple GUIs quick, accessible and understandable for children. It is a Python 3 library based on Tkinter, for creating simple GUIs.
Python for (originally MS') .NET platform. See IronPython for more info.
Jython is an implementation of the high-level, dynamic, object-oriented language Python seamlessly integrated with the Java platform. See Jython
Windows, MacOSX, Linux, Android, iOS
OpenGL ES accelerated framework for creating new user interfaces. Kivy have a native multitouch support for every platform, mouse simulator, widgets multitouch ready, integrated virtual keyboard, rst renderer...
Windows, MacOS, Linux
Not strictly a GUI toolkit, but a high-level multimedia framework that allows construction of media-rich guis.
supports Windows/Unix/Mac and provides access to OpenGL features. Stands for Fast, Light Toolkit.(Python 2 & 3)
Qt & OpenGL
A Python framework to develop GUI application, which promotes modular software design and code reusability with minimal effort.
Primarily an introduction to game programming. Only supports one window.(Python 2 & 3)
Windows, MacOS, Linux
Cross-platform windowing and multimedia library that heavily uses OpenGL.
PyGObject (aka PyGI). Python Bindings for GLib/GObject/GIO/GTK+. Replacement for PyGtk. See PyGobject
See PyGtk. Bindings for pango, atk, gtk and libglade. Good documentation from the Gtk Project. Wrapper uses some C programming style Note: New users are encouraged to use GTK+3 through the PyGObject bindings instead of using PyGTK with GTK+2. Windows users may still want to keep using PyGTK until more convenient installers are published.
Pure Python GObject Introspection Repository (GIR) wrapper using ctypes. Supported CPython >= 2.6, CPython 3.x, PyPy >= 1.4.0, and on all platforms where gobject introspection is supported.
Cocoa / Gtk / Win32
Abstract, pythonic API encapsulating different platforms.
Python bindings for the Qt application development framework (Python 2 & 3)
Python bindings for the Sciter - embeddable HTML/CSS UI engine. Windows, MacOS, Linux and mobiles.
The Qt for Python (PySide) project provides licensed Python bindings for the Qt cross-platform application and UI framework.
tkinter, Qt, wxPython,Browser, Win, Mac, Linux, Pi, PyDroid3, Trinket
Wraps tkinter, Qt (pyside2), wxPython and Remi (for browser support) in a non-OOP API. Build custom GUI layouts in a few minutes in a few lines of code. Easy enough for beginners, powerful enough for advanced users. Extensive documentation. 100+ Built-in color themes. Runs online using Trinket. 200 example programs.
Cocoa / Win32 / Qt / GTK
Pywebview is a lightweight cross-platform native wrapper around a webview component that allows to display HTML content in its own dedicated window.
OLPC XO with Linux
User interface for collaborative educational software
OSX, GTK+, iOS
Cross platform, Python native GUI toolkit that uses native system widgets. Under development as part of the BeeWare project. (Latest releases)
Included in Python standard library
Python's 'standard' GUI library (Documentation)
Qt or Wx on Windows, MacOS, Linux
The Traits/TraitsUI package offers the ability to build scalable and cross-platforms GUIs simply by focusing on the model being viewed, and offering default widgets for various types of objects. It abstracts away the implementation, which can currently use PyQt, Pyside or WxPython. In the simplest case, it can automatically generate a user interface for editing a (Traits-based) object, with no additional coding on the part of the programmer-user. In more sophisticated uses, it can implement a Model-View-Controller (MVC) design pattern for Traits-based objects.
The Visualization ToolKit (VTK) is an open source, freely available software system for 3D computer graphics, image processing, and visualization.
Supports Windows/Unix/Mac. See wxPython. Supports Python 2.7 and >=3.4, pip installable. Wraps & extends the wxWidgets toolchain. Permissive Licence.
A plugin for Android Studio's Gradle-based build system. Supports embedding Python code within a regular Java/Kotlin app, or writing an app entirely in Python with full access to the Android API.
Supports Cocoa Aqua GUIs on the Mac
LGPL MagicUserInterface wrapper for Python. Support for MorphOS 2.x.(Python 2.7)
Previously called win32all. Also known by the names of its components: PythonWin (for the UI), Win32Com (for COM/ActiveX), Win32 (for some other parts of the API)
GUI Design Tools and IDEs
Latest update date
GPL. a full featured Python and Ruby editor and IDE, integrating the highly flexible Scintilla editor control.(Python 2 & 3 versions)
Visual GUI Designer, Inspector and Property Editor (embeddable). PythonCard 'fork'. LGPL3.
GPL. Glade is a RAD tool to enable quick & easy development of user interfaces for the GTK+ toolkit and the GNOME desktop environment.
MacOSX, Win, Linux
App to creating 2D visuals using Python programming code.
GUI editor for Windows, Mac and Linux.
GPL TkInter GUI builder (exports XML '.ui' files) and RAD tool inspired by Glade.
MIT Open Source IDE developed using Python and Delphi. See PyScripter.(Python 2 & 3)
An interactive environment for python, suitable for interactive GUI programming with different GUI toolkits (wxPython, TkInter, pyGTK, pyQT4 and PySide)
GPL cross-platform WYSIWYG GUI builder. Can produce XRC/XML, wxWidgets/C++, or wxPython/python.
MIT License, wxGlade is a GUI designer written in Python with the popular GUI toolkit wxPython, that helps you create wxWidgets/wxPython user interfaces.. See WxGlade supports Python 2.7 & >=3.4 + wxPython >=2.8 or >=4.0
http://en.wikipedia.org/wiki/Comparison_of_integrated_development_environments#Python - Wikipedia article describing several IDE's and GUI Builders.
Gui For Python Script
The above lists should be arranged in ascending alphabetical order - please respect this when adding new frameworks or tools.
Best Gui For Python Mac