Vim, PyCharm Community Edition, and Spyder are probably your best bets out of the 21 options considered. 'Keyboard-based, mouse-free interface' is the primary reason people pick Vim over the competition. This page is powered by a knowledgeable community that helps you make an informed decision.
- Python
- Python On The Mac
- Using Python On Mac
- Best Editor For Python Mac Os X
- Best Editor For Python Programming
- Python Editor For Mac
- How to run a Python script¶. Your best way to get started with Python on Mac OS X is through the IDLE integrated development environment, see section The IDE and use the Help menu when the IDE is running. If you want to run Python scripts from the Terminal window command line or from the Finder you first need an editor to create your script.
- I sometimes find the Java setup on my various Apple devices to be a mystery. Recently, I was trying to get a Java applet to run in the same way on 2 iMacs and my MacBook Air. The applet is a simple vpn client from Juniper that lets me access a Citrix Desktop from any Mac that I can install the Citrix receiver client on so I can work on 'Company stuff' from a large screen iMac when I'm sat at.
If you have anything to contribute -- e.g. configurations for editors, new editors, or opinion -- don't hesitate to edit or create pages.
There's an EditorConfigurationHowto available.
Contents
Please keep wiki links as wiki links, use external links only if there is no existing page for the editor. Please add pages like BoaConstructor also to page IntegratedDevelopmentEnvironments.
Multiplatform Editors
Name | Platform | Impl. Language | License | Notes |
Linux, FreeBSD | Python, GTK | GPLv3 | Embed Vim. Little brother of PIDA | |
Unix/X, Windows, Mac OS X | Tcl/Tk | Proprietary | Extensible in Tcl, Tk; Can interact with python. | |
Unix/X, Windows, Mac OS X | Python | MIT | Python language support for Atom-IDE, powered by the Python language server. | |
Linux, Windows, Mac OS X | C++, wxWidgets | GPLv3 | class browser does not currently work for .py files, but it's still a nice IDE to use for python projects | |
Linux, Windows, Mac OS X | C, GTK+ | GPLv3 | The link points to the features page. | |
Linux, Windows, FreeBSD | C | GPLv3 | Cream is a free and easy-to-use configuration of the powerful and famous Vim text editor for both Microsoft Windows and GNU/Linux. | |
Unix/X, Windows, Mac OS X | C, GTK+ | GPLv2 | CSS editor with syntax highlighting for Python, and embeded Python interpreter. Extensible through a Python API. | |
Unix/X, Windows, Mac OS X | Python, wxPython | BSD | Extensible in Python; part of PythonCard. Includes PyCrust shell. | |
Unix/X, Windows, Mac OS X | Python, PyQt | GPLv3 | Complete IDE, very well integrated with PyQT development, but usable for any kind of project. Supports projects, debugging, auto-complete, syntax coloring, etc. It is extensible via plug-in system. It has interfaces to Subversion and Mercurial. | |
Unix/X, Windows, Mac OS X | Proprietary | BRIEF-compatible, supports Python syntax, in-buffer Python interpreter, supports lots of languages. Powerful macro language. | ||
Windows, Mac OS X, Linux | Tcl/Tk | Public domain | DRAKON diagram editor with code generation in Python. | |
Windows, Linux and Mac/MacPorts | Python, PyGTK | GPLv3 | Interactive shell with history box and code box, auto-completion of attributes and file names, auto-display of function arguments and documentation. Keeps your recent results, provides session history saving (optionally in HTML), interactive plotting with matplotlib. Extremely fast and responsive. | |
Unix/X, Windows, Mac OS X | Python, wxPython | GPL | Simple, Highly Customizable Editor/Environment. A Tribute to DrScheme. | |
Unix/X, Windows, Mac OS X | Java | EPL | Eclipse is .. an open extensible IDE for anything and nothing in particular.' Support for Python can be obtained via the PyDEV plugin. | |
Linux, Windows | Proprietary | Built-in Python syntax highlighting, Python class browsing, Python-compatible regular expressions, code folding, and extensive options for running external tools such as Python scripts. | ||
Linux, Windows, Mac OS X | Python, wxPython | wxWindows | A general purpose developer's text editor written in Python/wxPython. It supports python syntax highlighting, auto-ident, auto-completion, classbrowser, and can run scripts from inside the editor. Extensible with plugins written in python. | |
Unix/X, Windows, Mac OS | C, Lisp | GPLv3 | Python support with EmacsPythonMode. Extensible in Python using pymacs | |
Linux, Windows, FreeBSD and OS/2 | Proprietary | Customizable Python mode, syntax coloring, function tagging. | ||
Linux, Windows, Mac OS | Python, PyQt4 | GPLv3 | Extensible editor written in Python, Python/C/Nim code tree browser, 3-window editing, text diff, multi-language support, Python REPL, manipulate editor text with Python code | |
Unix/X, Windows, DOS, OS/2 | C++ | GPL | Supports lots of languages, including Python; doesn't seem programmable | |
Unix/X, Windows | C, GTK+ | GPLv2 | A small and lightweight GTK+ IDE that supports lots of languages, including Python. | |
Unix/X, Windows, Mac OS | C, Python | GPLv2 | gedit is the official text editor of the GNOME desktop environment, with Python syntax highlighting. | |
Unix/X, Windows, Mac OS | Python, PyQt | Proprietary | Ideas is a feature rich IDE that supports debugging, interpreting and project management. | |
Linux, Windows, Mac OS X | Java | GPLv2 | syntax coloring for python, extensible with jython, supports many file formats, has folding, fully customisable, has sidebar for class and functions, fast for a Java application | |
Unix, Windows, Mac OS | Java Best pdf editor for mac. | GPLv3 | IDE with Jython Shell. Syntax coloring for python, extensible with jython, supports many file formats, fully customisable, has sidebar for class and functions | |
Unix, Windows | C | GPLv2 | Supports Python syntax and a Python-specific menu. | |
Unix, VMS, MSDOS, OS/2, BeOS, QNX, and Windows. | C | Syntax highlighting and indenting, (optional) emacs keybindings, programmable with s-lang. Note: comment out 'msw_help(..' line in pymode.sl if you are having problems on Windows. | ||
Unix, Windows, Mac OS | Java | GPLv2 | Has three plugins - one for Jython and one for Python/Jython JpyDbg - interactive editing debugging, code browsing, highlighting. | |
Linux, Windows, Mac OS | Java, Python | GPL | NetbeansjEdit cross IDE plugin | |
Unix/OSX/Cygwin/Interix (curses), MS-DOS (DR DOS, FreeDOS, Win, OS/2 DOS-Box) | C | GPL | Versatile WordStar-like editor (JOE fork) with many colourised syntax-highlighting modes | |
Linux, Windows, Mac OS | C++ | GPLv2 | Kde main developping app. Code folding, syntax highlighting, navigator. projects, class browser, version control, customizable keybindings. Comes also with some typical python project models: pyton Qt app, Tkinter app and simple script. | |
Unix, Windows, Mac OS X | Proprietary | Komodo is an award winning Python IDE from ActiveState. Fully-integrated Python Python 2.x and Python 3 support featuring code intelligence with autocomplete and calltips, Python debugger (includes remote debugging), interactive shell, remote file support, macros, templating, emacs command support and great help documentation. There is also an open-source version called Komodo Edit (Source), as part of the Open Komodo project started November 2007. | ||
Unix/X, Windows, Mac OS X | Proprietary/Open Source | scaled-down version of Komodo IDE which also supports Python, but excludes the integrated debugger. | ||
Unix/X, Windows, Mac OS X | Python, wxPython | GPLv3 | Python IDE with focus is on simplicity and ease of use. It is fast and lightweight. It features Python indentation, line numbers, code folding, syntax highlighting, shell access, code completion, a program runner, a source browser, indentation guides, a white space indicator, autosaving, an edge line, multiple tabs, printing, jumping to a specific line, word searching, word replacement, zooming undo/redo, pastebin.com code submission, Python syntax checking, the ability to change the indentation of many lines at once, autocompletiton, and bad brace checking. | |
Linux, Windows, Mac OS X | Python, PyQt | MIT | Outlining editor, fully scriptable and extensible, supporting literate programming. 100% pure Python code. | |
Unix, Windows | C, GTK+ | LGPL | Gtk editor with python bindings, allows plugins written in python. | |
Linux, Windows | C | GNU GPL | Small, terminal-based editor, Syntax highlighting | |
Unix, Windows, Mac OS X | C | GPLv3 | Easy to use, small, powerful, fast, terminal-based editor. Supports UTF-8, syntax highlighting, undo, autocomplete, macros, regexes, bookmarks. v2.4 released 2012-04 | |
Unix/X, Windows, Mac OS X | C | GPLv2 | X-Based, Python support builtin. | |
Unix/X, Windows, Mac OS X, others | Java | GPLv2 | Netbeans is an open extensible cross platform IDE ; Support for Python can be obtained via the JpyDbg plugin. A new plugin exists for Netbeans 6.5 or newer - info. | |
Linux, Windows, Mac OS | GPLv3 | Lightweight and extensible editor. Class browser, project manager, PEP8 finder, virtualenv, plugin support | ||
Unix/X, Windows, Mac OS X | Python, wxPython | GPLv2 | wxPython based editor. Can be easily extended with mixins and plugins, and has many features. Seems to be biased towards Python web development as contains FTP GUI, RSS aggregator and HTML preview. | |
Windows NT, Linux (with GTK+ 2) | C++, wxWidgets | Freeware | Easy to use text editor with syntax highlighting for Python. Embeds the Python interpreter to extend functionality of the application | |
Linux, Windows, Mac OS X | Java | Apache 2.0 | Full-featured IDE for Python. Has Free and Open Source edition fully supporting Python as well as proprietary Professional Edition with Django, Flask, Pyramid and Google App Engine support. | |
Linux, Windows, Mac OS X | Java, Eclipse | EPL | Eclipse plugin. Code-completion. Debugger. Under active development. (ShowMeDo Videos) | |
Linux, Windows | Python, Tk | GPLv3 | Ultra-lightweight Python/text editor made in Python with Tk. Emphasis on easy customization and no-bloat attitude. | |
Unix, Windows, Mac OS X | Python, wxPython | GPLv2 | Written in Python - code folding, snippets, unicode, multiple documents, code completion, several languages, macros. | |
Linux, Windows, Mac OS X | MIT | Free open-source extension for Visual Studio Code. Supports syntax highlighting, debugging, code completion, code navigation, refactoring, with support for Django, multi threaded, local and remote debugging. | ||
Windows/Linux/Mac (wxPython) | Python | GPLv3 | An interactive environment for python features include: Multiple independent python interpreters. Interactively program with different GUI toolkits (wxPython, TkInter, pyGTK, pyQT4 and PySide). Matlab style namespace/workspace browser. Object auto-completions, calltips and multi-line command editing in the console. Object inspection and python path management. Simple code editor and integrated debugger. | |
Unix/X, Windows, Mac OS X | Python, PySide | BSD License | Open-source Python IDE focused on interactivity and introspection, which makes it very suitable for scientific computing. Its practical design is aimed at simplicity and efficiency. Pyzo consists of two main components, the editor and the shell, and uses a set of pluggable tools to help the programmer in various ways: e.g. source structure, interactive help, workspace, file browser (with functionality for searching). Also includes a post-mortem debugger. | |
SciTE | Windows, Linux (GTK+) | C++ | MIT-Like | A highly configurable light-weight source code editor (about 50 file formats) based on widely-used Scintilla rich text widget/control. Features: sytax highlighting, code folding, auto-indent, brace matching, codepage/unicode support, multiple documents, context help, code execution, output pane, external tools support, RegExp find/replace, text export (HTML, RTF, PDF, LaTeX, XML). Python API for calltips and autocompletion available. |
Windows, Linux, Mac OS X | Python, wxPython | GPLv3 | Stani's Python Editor. Auto indentation, auto completion, call tips, syntax coloring/highlighting, UML viewer, class explorer, source index, auto todo list, sticky notes, integrated PyCrust shell, Python file browser, recent file browser, drag&drop, context help. Blender support with a Blender 3D object browser, runs interactively inside Blender. Ships with WxGlade (GUI designer), PyChecker (source code doctor) and Kiki (regular expression console). Extensible with WxGlade. (ShowMeDo Videos) | |
Windows, Linux, macOS | Python, PyQt5 | MIT | Spyder is a powerful scientific environment written in Python, for Python,and designed by and for scientists, engineers and data analysts. It features a unique combination of the advanced editing, analysis, debugging and profiling functionality of a comprehensive development tool with the data exploration, interactive execution, deep inspection and beautiful visualization capabilities of a scientific package. Furthermore, Spyder offers built-in integration with many popular scientific packages, including NumPy, SciPy, Pandas, IPython, QtConsole, Matplotlib, SymPy, and more. Beyond its many built-in features, Spyder's abilities can be extended even further via first- and third-party plugins. It is conveniently integrated in the cross-platform Anaconda distribution, and is the centerpiece of the Python(x,y) and WinPython distributions for Windows. | |
Unix/X, Windows, Mac OS X | Proprietary | Syntax coloring, popup function arguments, class hierarchy browser, graphical debugger, and other nice Python features. Context tagging with class/module namespaces, code navigation, and smart indenting are also supported. | ||
Linux, Windows, Mac OS X | C++, Python | Proprietary | Beautiful interface, Python syntax highlighting, Python plugins. | |
Linux, Windows, Mac OS X | Python | MIT | For teaching/learning programming. Focused on program runtime visualization. Provides stepping both in statements and expressions, no-hassle variables view, separate mode for explaining references etc. | |
Unix/X, Windows, Mac OS | C | Charityware | Highly configurable text editor built to enable efficient text editing. Syntax coloring, indenting, autocompletion, and source-navigation tools for Python. Can be scripted in Python. See also Cream. | |
Unix/X, Windows, Mac OS X | Proprietary | Powerful commercial IDE designed specifically for Python. Auto-completion, call tips, syntax highlighting, goto-definition, keyboard modes for emulating Visual Studio, VI/Vim, Emacs, & Brief, graphical debugger, code browser, integrated shell, scriptable in Python, and much more. (ShowMeDo Videos) | ||
Linux, Windows | Python, wxPython | GPL | Simple text editor written in python. Syntax highlighter, Code fold, Export code in HTML.. |
Python
Unix-Only Editors
Name | Platform | FreeSoftware? | ZeroPrice? | Notes |
Unix + GTK | X | Supports debugging Python, Tcl, Ruby, Perl, Lua scripts. Code intelligence (Code completion, folding, auto-complete, code snippets, syntax highlighting matching tags, show keyword or variable information when mouse over..). Keyword help and improved script document. Integrated commonly-used scripting libraries (Tk, wxPython, Pygame, Pmw, Numeric..). Supports compiling python scripts to Windows EXE files. |
Windows-Only Editors
Name | Platform | Impl. Language | License | Notes |
Windows | C++ | GPL | Notepad++ is a free source code editor and Notepad replacement that supports several languages. Running in the MS Windows environment, its use is governed by GPL License. Based on the powerful editing component Scintilla, Notepad++ is written in C++ and uses pure Win32 API and STL which ensures a higher execution speed and smaller program size. By optimizing as many routines as possible without losing user friendliness, Notepad++ is trying to reduce the world carbon dioxide emissions. When using less CPU power, the PC can throttle down and reduce power consumption, resulting in a greener environment. | |
Windows | Pascal/Delphi | MIT | Free and open-source Python IDE created with the ambition to become competitive in functionality with commercial Windows-based IDEs |
Macintosh-Only Editors
Name | Platform | Notes |
Mac OS | Python-mode extensible in Tcl | |
Mac OS X 10.4 or later | Full-featured text editor; includes Python support. TextWrangler is the free version (see below). | |
Mac OS X 10.7 or later | General purpose editor with autocompletion for the Python standard library, plus inline documentation. | |
Mac OS X 10.4 or later | 'text editor + file transfer + svn + css + terminal + books + more = whoah. welcome to coda. grow beautiful code.' | |
Mac OS X (Cocoa) | Programmer's text editor with Python syntax highlighting. Written in Python with PyObjC. Open-source (GPL). | |
OS X (Cocoa) | Fork of Smultron. No longer under development | |
Mac OS | Included in MacPython distribution. | |
Mac OS 68k Mac OS 9 Mac OS X | Does not initially include Python support but new language modes can be created. One available here Mi_Python | |
Mac OS X | Python syntax coloring. Allow multiple author to edit the same file collaborativelly over the network using 'Bonjour' (previously Rendezvous). | |
Mac OS X 10.4 or later | Free and full-featured text editor based on BBEdit. Includes Python syntax highlighting. | |
Mac OS X | Free IDE and text editor. Includes Python syntax coloring. | |
Mac OS X 10.3.9+ | Great Cocoa editor with Python support including syntax coloring, integrated documentation, and a runtime wrapper with hyperlinked tracebacks. Note that code-folding of classes is currently broken for PEP 8 compliant code. | |
Mac OS X 10.6 or later | Again under active development, support for Python syntax coloring. Only available in the Mac App Store. | |
Mac OS X 10.3 or later | Free OS X based IDE for the Python (and other) programming language (replaces discontinued PyOXIDE), with syntax coloring, completion, tool tips, source level debugger, help browser, etc.. | |
Mac OS X 10.6 or later | Free text editor, with Python syntax highlighting. A paid pro version with more features is also available. |
Online Editors
Name | Notes |
A general web-based IDE with support for Python. Provides a full Ubuntu environment with Python 2.7.6, and support for Django workspaces. | |
An interactive Python IDE for data exploration and visualization. Provides a full online Anaconda-based Python environment, with real-time collaboration, interactive IPython sessions, and easy publishing of output figures and code. Includes syntax highlighting and autocomplete. The service was shut down on 2nd Jan 2017 | |
'Host, run, and code Python in the cloud!' Free and paid plans include access to multiple versions of CPython, PyPy, IPython notebooks, a large selection of third-party modules, bash and MySQL shells, and more. | |
An online IDE for numerical and data science computing experiments - includes: real-time collaboration, a customizable editor, a console and much more. The basic account is free of charge. | |
A collection of computational mathematics tools in the cloud, including IPython notebooks, SageMath, Numpy/Scipy/Matplotlib, and Cython. | |
Continuum Analytics' (distributors of the Anaconda Python distribution) hosted data analysis environment. Includes IPython notebooks, data visualization methods like matplotlib and bokeh, ability to add AWS nodes and clusters, command-line shells, file storage, SSH access, and other elements. (Some features require paid account) |
Glorified Editors
'IDEs' that don't integrate anything Python-specific go here.
Name | Platform | Notes |
Unix + GNOME | Cross-language IDE; syntax coloring & folding for Python. | |
Linux x86 | Commercial IDE with support to 30 other languages. | |
Unix | Commercial cross-language IDE; nice multi-user project manager. | |
Windows | Cross-language IDE with integrated SQL support and automation features (currently German only GUI) | |
Python + wxPython | Simple, Highly Customizable Editor/Environment. A Tribute to DrScheme. | |
Java + Jython + Python | An OpenSource IDE for Python, Jython, and Java. Supports Syntax highlighting, Code Completion and many more. Developed in Java. | |
Python + Tkinter + Tix | An extended version of IDLE using Tix. | |
Java | Java IDE with Python support through Pythonid plugin - includes code completion, syntax & error highlighting, intra-file refactoring | |
Unix + KDE | Cross-language IDE for KDE - supports Python syntax/projects. | |
Java | A Java IDE with an optional plugin for Jython. | |
Windows/X (Python+wxPython) | Written in Python - code folding, snippets, unicode, multiple documents, code completion, several languages, macros. | |
Windows | Available either as part of ActiveState's ActivePython distribution (which is not open source) or as part of the Win32All extensions from Mark's pages (which is open source). | |
Unix/Windows/Mac | rope is a python IDE aimed at providing a rich set of software refactorings. | |
Unix/Windows with Tcl/Tk | Cross-language IDE & Source code analysis tool. | |
Eclipse | Python and PHP IDE; available in commercial Professional and open-source Foundation versions | |
Windows | GUI designer for wxPython. | |
Linux/Windows/Mac | Full featured, free IDE bundled with wxPython, features projects, scintilla, and debugging | |
Unix/Windows/Mac | Non-free Cross-language GUI dialog designer with integrated support for editing your Python callback functions. | |
Unix/Windows/Mac | A 'designer' for WxPython (requires wxPython) | |
Unix/Windows/Mac | Multi-language editor that support python autocomplete, Direcotry/class browser, tags/multi-views editing, unicode, and Django wizard(requires wxPython) | |
Python Tkinter | GUI, class browser, file manager, with code completion. Licensed under the GPL. |
Enhanced Python shells
Name | Platform | Notes |
Python + PyCrust | Interactive Python shell included in wxPython. | |
Python + PySlices | New 'notebook' version of PyCrust with save/load features and the ability to run blocks of code in separate 'slices'. | |
Unix, Mac OS X, Windows | Enhanced interactive Python shell. Also usable as pythonic system shell (bash/cmd.exe) replacement. Supports autocompletion. Inline syntax highlighting. (ShowMeDo Videos) | |
Java, at least 1.4 | Interactive, embeddable Jython shell with code completion. Licensed under the QPL. | |
win32 | Interactive python shell using wxPython. py script and exe for win. Data plotting capability from within the shell. Free. | |
KDE | An interactive Python shell using PyKDE and a KHTMLPart (for HTML rendering). | |
Python 2.3 (or higher) and PyQt | An interactive Python shell using PyQt. | |
Unix, Mac OS X | Interactive shell with highlighting and autocomplete. |
Mobile Device Editors
'IDEs' that run on mobile devices and tablets.
Name | Platform | Notes |
iOS | Universal iOS (iPod Touch, iPhone, iPad) IDE. | |
iOS | Universal iOS (iPod Touch, iPhone, iPad) IDE. | |
iOS | Universal iOS (iPod Touch, iPhone, iPad) IDE. | |
iOS | Universal iOS (iPod Touch, iPhone, iPad) IDE. | |
iOS | Universal iOS (iPod Touch, iPhone, iPad) IDE. | |
iOS | Universal iOS (iPod Touch, iPhone, iPad) IDE. | |
iOS | Universal iOS (iPod Touch, iPhone, iPad) IDE. | |
iOS | Universal iOS (iPod Touch, iPhone, iPad) IDE. | |
iOS | IDE for iPad | |
iOS | A Python Interpreter focused on math modules | |
iOS | IDE for iOS with native graphic and sound support through high-level API; games and interactive demos included | |
iOS | IDE for iPhone and iPad with Python 3 support. Custom library is supported. See Python Box page for details. |
Other Resources
- Vaults of Parnassus Editor/IDE page.
- Open Directory Project's Python Tools page.
- PySmell provides autocompletion for Vim, Emacs and TextMate
Never ending debate
- EmacsVsVi
CategoryEditorsCategoryEditorsCategoryEditorsCategoryEditorsCategoryEditorsCategoryEditorsCategoryEditorsCategoryEditorsCategoryEditors
Bob Savage <bobsavage@mac.com>
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.
What you get after installing is a number of things:
- A
Python3.7
folder in yourApplications
folder. In hereyou find IDLE, the development environment that is a standard part of officialPython distributions; PythonLauncher, which handles double-clicking Pythonscripts from the Finder; and the “Build Applet” tool, which allows you topackage Python scripts as standalone applications on your system. - 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/).
Python On The Mac
To run your script from the Terminal window you must make sure that
/usr/local/bin
is in your shell search path.Using Python On 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.
With Python 3.7, you can use either python or pythonw.
4.1.3. Configuration¶
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 .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. Simple photo editor for mac. 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.
Best Editor For Python Mac Os X
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¶
Best Editor For Python Programming
The “Build Applet” tool that is placed in the MacPython 3.6 folder is fine forpackaging small Python scripts on your own machine to run as a standard Macapplication. This tool, however, is not robust enough to distribute Pythonapplications to other users.
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¶
Python Editor For Mac
The MacPython mailing list is an excellent support resource for Python users anddevelopers on the Mac:
Another useful resource is the MacPython wiki: