Gui For Python Mac



Author

Bob Savage <bobsavage@mac.com>

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¶

Gui For Python Mac

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:

  • A 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.

  • A framework /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/System/Library/Frameworks/Python.framework and /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.

Gui For Python Mac

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.

Mac

With Python 3.9, you can use either python or pythonw.

4.1.3. Configuration¶

Python on OS X honors all standard Unix environment variables such asPYTHONPATH, but setting these variables for programs started from theFinder is non-standard as the Finder does not read your .profile or.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 (pythonsetup.pyinstall).

  • 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:

Python gui for macos

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.

Cross-Browser Frameworks

Package

Target

Latest version

Latest update date

Notes

All major Web Browsers

0.12

2020-08-28

For versatile GUIs written in HTML/CSS and Python (no JavaScript needed) - The lightweight and easy-to-use toolkit to begin with GUI programming.

All major Web Browsers

0.8

2012-06-01

Comprehensive Widget toolkit, Python-to-Javascript compiler and AJAX library. Provides the 'V' in MVC. Note PyjamasDesktop was merged into pyjamas.

Cross-Platform Frameworks

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.

Package

Target

Latest version

Latest update

Notes

Windows, MacOS, Linux

0.94

2019-05-26

Simple & intuitive wrapper for Tkinter. In active development, designed for educational purposes, heavily documented & feature rich!

Linux / many

0.11.0

2016-02-16

Fully automatic, live connection among graphical interface widgets and application variables.

Windows, MacOS, Linux

66.0

2018-08-20

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.

0.9.16

2016-08-16

Dabo is a 3-tier, cross-platform application development framework, written in Python atop the wxPython GUI toolkit

Windows, MacOS, Linux

0.4.605

2020-10-12

DearPyGui A GPU Accelerated Python GUI Framework. At its' core it is a Python implementation of DearImGui. Docs are located on the Github Pages.

Qt

1.1.0

2015-11-15

A tiny Python module for creating form dialogs/widgets to edit various type of parameters with having to write any GUI code

WxPython (WxWidgets)

0.9.3

2013-08-26

Both a framework and visual tools: GUI Designer, Inspector and Property Editor. Supports Python 2.5 to Python 3.2; wxPython 2.8 'stable', 2.9 'classic' and 'phoenix' (py3k). Features advanced pythonic MVC controls (ListView, GridView, TreeView) using list- and dict-like objects; masked and date picker controls; common dialogs; fluid layout using sizers & basic HTML; simplified event model (similar to JavaScript). Can include wxPython code in apps. Modern PythonCard 'fork' hugely enhanced.

Qt

1.7.6

2016-10-09

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.

Qt

0.3.5

2020-07-10

A Qt wrapper that makes it extremely easy to create simple graphical interfaces

wxPython

1.0.3

2019-09-22

Converts most argparse based CLI programs into wxPythonGUI programs with a single import and decorator.

Windows, MacOS, Linux (Tkinter based)

1.1.0

2019-10-24

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.

.NET/Mono

2.7.4

2013-09-07

Python for (originally MS') .NET platform. See IronPython for more info.

Java

2.7.1

2017-06-30

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

1.11.0

2019-06-01

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

1.8.2

2014-07-16

Not strictly a GUI toolkit, but a high-level multimedia framework that allows construction of media-rich guis.

1.3.1

2012-02-19

supports Windows/Unix/Mac and provides access to OpenGL features. Stands for Fast, Light Toolkit.(Python 2 & 3)

Qt & OpenGL


2016-12-20

A Python framework to develop GUI application, which promotes modular software design and code reusability with minimal effort.

1.9.6

2019-04-25

Primarily an introduction to game programming. Only supports one window.(Python 2 & 3)

Windows, MacOS, Linux

1.4.8

2019-11-21

Cross-platform windowing and multimedia library that heavily uses OpenGL.

Gtk?

3.34.0

2019-09-12

PyGObject (aka PyGI). Python Bindings for GLib/GObject/GIO/GTK+. Replacement for PyGtk. See PyGobject

Gtk

2.24.0

2011-04-01

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.

GObject Introspection

0.1.1

2011-03-29

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

2.5.3

2011-07-16

Abstract, pythonic API encapsulating different platforms.

Qt

5.15.1

2020-09-12

Python bindings for the Qt application development framework (Python 2 & 3)

Sciter

4.3.0.6

2016-02-16

Python bindings for the Sciter - embeddable HTML/CSS UI engine. Windows, MacOS, Linux and mobiles.

Qt

5.15.0

2020-06-15

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

4.20.0

2020--06-06

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

0.8.2

2015-10-08

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

0.98.5

2013-03-08

User interface for collaborative educational software

OSX, GTK+, iOS

0.2.4

2016-10-13

Cross platform, Python native GUI toolkit that uses native system widgets. Under development as part of the BeeWare project. (Latest releases)

Tk

Included in Python standard library

Python's 'standard' GUI library (Documentation)

Qt or Wx on Windows, MacOS, Linux

6.0.0

2018-04-03

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.

many

6.1.0

2014-01-22

The Visualization ToolKit (VTK) is an open source, freely available software system for 3D computer graphics, image processing, and visualization.

4.0.4

2019-01-05

Supports Windows/Unix/Mac. See wxPython. Supports Python 2.7 and >=3.4, pip installable. Wraps & extends the wxWidgets toolchain. Permissive Licence.

Platform-specific Frameworks

Package

Target

Latest version

Latest update

Notes

8.0.1

2020-07-28

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.

MacOSX

6.2.2

2020-07-08

Supports Cocoa Aqua GUIs on the Mac

MorphOS

0.7.0

2013-12-27

LGPL MagicUserInterface wrapper for Python. Support for MorphOS 2.x.(Python 2.7)

Windows

228

2020-06-13

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

IDE

Target

Latest version

Latest update date

Notes

5.4.2

2014-03-09

GPL. a full featured Python and Ruby editor and IDE, integrating the highly flexible Scintilla editor control.(Python 2 & 3 versions)

0.9.6.1

2016-09-05

Visual GUI Designer, Inspector and Property Editor (embeddable). PythonCard 'fork'. LGPL3.

3.16.1

2013-12-18

GPL. Glade is a RAD tool to enable quick & easy development of user interfaces for the GTK+ toolkit and the GNOME desktop environment.

12.0.1

2020-02-10

Commercial

MacOSX, Win, Linux

3.0.38

2014-01-24

App to creating 2D visuals using Python programming code.

TkInter, Tix

4.2.1

2014-02-21

GUI editor for Windows, Mac and Linux.

0.10.3

2020-10-03

GPL TkInter GUI builder (exports XML '.ui' files) and RAD tool inspired by Glade.

Windows

2.5.1

2012-03-19

MIT Open Source IDE developed using Python and Delphi. See PyScripter.(Python 2 & 3)

Windows/Linux/Mac

13.01

2013-03-07

An interactive environment for python, suitable for interactive GUI programming with different GUI toolkits (wxPython, TkInter, pyGTK, pyQT4 and PySide)

3.9.0

2018-10-26

GPL cross-platform WYSIWYG GUI builder. Can produce XRC/XML, wxWidgets/C++, or wxPython/python.

0.9.2

2019-03-07

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

Links

http://en.wikipedia.org/wiki/Comparison_of_integrated_development_environments#Python - Wikipedia article describing several IDE's and GUI Builders.

Editorial Notes

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

CategoryPyGUI