[Pythonmac-SIG] editing Python scripts on OS X

Kevin Altis altis@semi-retired.com
Sat, 27 Apr 2002 13:35:04 -0700


Okay, day one of Mr. Altis and OS X begins. ;-)

Can MacPython and MachoPython co-exist peacefully on OS X? Since MachoPython
is working I don't want to install MacPython only to find that I just
stomped my MachoPython install. In particular, the binary MachoPython 2.2.1
we're using with the wxPython Mac build available at:
http://sourceforge.net/project/showfiles.php?group_id=10718

As a side-note, I'm still wondering about MachoPython installed by Fink
compared to the binary installer. The differences in paths, conflicts, etc.
probably need to be documented and sorted out.

Editor recommendations on OS X are welcome.

The list at http://www.python.org/editors/ contains quite a few Unix &
Multiplatform Text Editors. What I want is a GUI editor that is
Python-aware, so it understands whitespace in Python scripts, can insert
four spaces instead of tabs, manage indent/dedent of code blocks and
preferably has syntax coloring and can run tabnanny, and jump to the line in
the source with a syntax error. It needs to be able to at least read and
save files with Unix (LF) line endings, but it would be best if it can deal
with Windows (CR/LF) and Mac (CR). I don't particularly care about more than
basic key bindings like Cut/Copy/Paste and arrow keys, I'm mostly a mouser.

OS X comes with Pico, vi and Emacs editors, but those aren't Python-aware
and you need to already be comfortable with the Unix shell and non-GUI
editors in order to use those effectively. Emacs can be configured to
recognize Python files (python mode), but I've forgotten how to do that and
I'm not sure what other ANSI terminal changes might be necessary to get
syntax coloring. Plus, I don't think Mac users without a Unix background
should be forced to use a non-GUI editor like Pico, vi, or Emacs. As a
former (but rusty) Unix admin I could use Emacs if I was forced to, but that
won't help a lot of other non-geeks and I want to be able to recommend an
editor to use on OS X in our PythonCard walkthroughs.

You can use TextEdit to edit Python files, but again it isn't Python-aware.
That leaves Alpha and BBEdit and those aren't free and I haven't spent any
time with them yet (well both of them many years ago, but that doesn't
count), so I'm not sure of how well they work with Python. IDLE doesn't
really work because tk doesn't really work on OS X. So, free or even
inexpensive Python-aware editors on OS X appears to be a big issue.

If possible I would like to use MacPython to edit Python scripts. I haven't
seen MacPython yet, but I have faith in Jack :) Thus my basic question of
whether MacPython and MachoPython can co-exist?

It might be nice if someone funded a Mac OS X port of Neil's Scintilla and
SciTE, so that we would have another free GUI source code editor that
handled a variety of languages.
  http://www.scintilla.org/

Sorry if this is a FAQ.

ka