[PYTHONMAC-SIG] Announce: A Python Programming Environment for Macintosh (alpha)

Just van Rossum just@knoware.nl
Tue, 27 May 1997 23:12:28 +0200


Dear Python People,

I've put a binhexed & stuffed file at:
    ftp://starship.skyport.net/pub/mac/just/PythonIDE.sit.hqx

I'll be away for the next week starting tomorrow way too early,
so if you find terrible problems with it, let me know *now* ;-).
I will respond to other feedback as soon as I get back.
Please give it a try, it's pretty cool!


Here follows the readme:


Python Integrated Developement Environment for the Macintosh
alpha 2 -- codenamed "Bruce"

copyright 1997 Just van Rossum, Letterror -- just@knoware.nl

May 27, 1997

This is the first public release of my stab at a Python
programming environment for the Mac. There is still a lot
on my wishlist, but I feel it can do enough to justify a
release. I'd appreciate any feedback.

It features a Python Interactive window, an integrated
editor, an object browser, a module browser and a very cool
traceback window. I hope to integrate Jack's debugger (TWIT)
in a next release.

Installation
You need Python 1.4 installed; either the PPC, CFM68k or
68k Classic distibution will do. The 68k Small verion will
*not* do. Set the interpreter's memory segment to at least
10 megs.
(Note for MacOS 7.6.1 CFM68k users: startup might fail with
an "ImportError: DragLib: library name not found in Frag
registry" error message. You need to install NuDragLib.
Mail me if you have trouble finding it)
Unpack the archive with StuffIt expander. The unpacked folder
may live anywhere, you don't need to edit sys.path. Leave it's
contents alone however. Double-click PythonIDE.py.
Startup time is a bit long, this should improve when I am able
to distribute a semi-self-contained fat-applet under Python 1.5.

Python Interactive Window
This looks and feels as much as possible like the Python
interpreter in interactive mode, minus the SIOUX bugs.
It has undo, and the window remembers its size and position
(and whether it was left open or not) between sessions.
If it's not open when you start, look at the Windos menu.

The Editor
The are two buttons at the top: Run window and Run selection.
The latter expands the selection to whole lines and then runs
it. This means that you can only execute snippets at the top
level of a module. I'm thinking of making this a bit more
tolerant somehow.
An edit window has its own namespace. However if a module
with a name that matches the window's title has already been
imported, the code will be executed in that module's
namespace. Which effectively means that if you run such a
window, it is equivalent to reload(module). The editor has
borrowed some features and shortcuts of BBEdit, like
indent/undent. Find & replace shortcut are BBEdit-ish as
well. It indents automatically after a colon.
There is a popupmenu at the right top side of the edit window
which currently has only one entry: Font Settings. It does
what you expect. It is not yet possible to set the default
font for new windows.
At the bottom on the left you find two more items of interest:
a field showing the current line number (click on it to enter
a different line number, then tab or enter or return or
click elsewhere to jump) and a popup menu pointing to all
function, class and method definitions in the module. For
very big modules it might take some time before the menu
gets drawn, especially on slower machines. I find it
acceptable on my 68040, however.

The Traceback Window
Whenever an exception is raised (except in the Python
interactive  window, this might have to change), instead of
the usual printout of the traceback you will be presented with
a traceback window, with all stack frames neatly presented in
a list. For each entry (stack frame) you can either open the
file with the editor (which will jump to the corresponding
line) or browse the local variables for that stack frame.
There is currently also the option to browse the stack frame
itself, but I have *never* used it so far, so I think I'm going
to drop that feature.

The Module Browser
Here you'll find a list of all currently imported modules
(= sys.modules). For builtin modules (or shared libs) there's
the option to browse the module; for modules written in Python
it allows you to open the module with the editor or reload it.
An additional option is Open Other, which will give you a
prompt to enter a module name (without .py). After you click
OK sys.path will be searched for it. When successful, it opens
it with the Editor.

The Object Browser
This is a browser I wrote quite some time ago, it works nicely
(except for the still not functioning Update button). I have
plans to rewrite it completely, and make it look more like
CodeWarriors variable browser (with finder-like foldout arrows).
You can start the browser in three different ways:
- choose Browse Objects from the Python menu, this will start at
  sys.modules
- choose Browse for one or more modules in the Module Browser
- choose Browse Locals in a traceback window

Menus
Not much to say about the menus, but do check the Windows menu.

Widgets
All of the windows in the environment (except for the object
browser, which is kindof obsolete) are built with a set of
widgets, collected in the module W. You'll find some (mostly
undocumented) demos in the WidgetsDemos folder.
ModuleBrowser.py is a more serious example, while still not
overly complex. Don't look at PyEdit.py, it's a mess.
The widgets have a very simple interface, with a smart
coordinate system (no grid yet, though). I will write up
some docs for this at some point.

The Python Font
I have designed a bitmap font to do all my coding with. It's
called Python-Sans. Originally (before it got it's current
name, about 10 years ago) I made it as a replacement for
Geneva 9 pt, to do Pascal coding. Even if you would rather
die than use a proportional font for coding (you can choose
a different one...), I recommend you to install it (drop it
on the System Folder), since all user interface elements are
sort of tuned to it. If you don't, it will default to Geneva,
and everything will look a little less slick.

Wishlist & Random notes
- Intelligent filters for files that use spaces or spaces and
  tabs for indentation. Right now the editor is rather dumb about
  this issue.
- Get rid of SIOUX (or at least I want to be able to *not*
  show it)
- sys.stdin emulation. Currently SIOUX is still handling that.
  It's not great, but it works.
- Default font settings for edit windows
- being able to change tab settings, unfortunately this is
  currently not possible with the WASTE library.
- Double clicking does not work the way I like it. Same problem
  as tab settings: hard to do with WASTE.
- Syntax coloring (working on it!)
- Save as Applet, with an option to semi-automatically collect
  modules. (freeze's findmodules.py would be excellent start for
  this, but it's not in the Mac distribution!)
- A debugger. It's basically there: Jack's wonderful TWIT, but
  I'd like to adapt the look and feel to my app (= redesign the
  user interface)
- Profiler -- A simple profiler stats window with sort
  options would be nice.
- Modularize function like PTUI. Turn a script into a module.
- Run window in __main__. (This to allow to run modules which
  contain the magic if __name__ == '__main__': etc. code.)

Licence
I am still pondering what exactly to do with it. For now:
You *cannot* re-distribute it without my permission.
This release lives exclusively at:
    ftp://starship.skyport.net/pub/mac/just/PythonIDE.sit.hqx
If you have questions, feel free to email me at just@knoware.nl.

Thank-you's
I'd like to thank my Big Brother Guido and MacPython guru
Jack Jansen for always being so patient with me.
Also many thanks to Erik van Blokland and his Big Brother Petr
for many early input and testing. Dooooh!


Enjoy!

Just van Rossum



_______________
PYTHONMAC-SIG  - SIG on Python for the Apple Macintosh

send messages to: pythonmac-sig@python.org
administrivia to: pythonmac-sig-request@python.org
_______________