Macintosh Python crash course


This set of documents provides an introduction to various aspects of Python programming on the Mac. It is assumed that the reader is already familiar with Python and, to some extent, with MacOS Toolbox programming. Other readers may find something interesting here too, your mileage may vary.

There is a companion document Using Python on the Mac which you should read before starting here: it explains the basics of using python on the Macintosh.

Another set of Macintosh-savvy examples, more aimed at beginners, is maintained by Joseph Strout, at http://www-acs.ucsd.edu/~jstrout/python/.

Some of these documents were actually written while I was working on a "real" project: creating a single-button application that will allow my girlfriend to read her mail (which actually pass thry my mailbox, so I get to read it too, but don't tell her:-) without her having to worry about internet connections, unix commands, etc. The application, when finished, will connect to the net using InterSLIP, start a (pseudo-)POP server on unix using rsh and use AppleScript to tell Eudora to connect to that server and retrieve messages.

These examples were all built using Python 1.3.3, which can be downloaded from ftp.cwi.nl, directory /pub/jack/python/mac, and possibly from the ftp.python.org server and its mirrors as well. Some examples may work with earlier versions of Python, some will definitely not.

Table of contents

The Python distribution contains a few more examples, all unexplained: At some point in the (possibly distant) future, I will add chapters on how to use bgen to create modules completely automatic and how to make your Python program scriptable, but that will have to wait.


Please let me know if you miss critical information in this document. I am quite sure that I will never find the time to turn it into a complete MacPython programmers guide (which would probably be a 400-page book instead of 5 lousy html-files), but it should contain at least the information that is neither in the standard Python documentation nor in Inside Mac or other Mac programmers documentation.


Jack Jansen, jack@cwi.nl, 18-May-1996.