Re: a few questions about the Mac implementation

Guido.van.Rossum@cwi.nl
Wed, 22 Mar 1995 00:52:01 +0100

> I'm trying to get started with Python on a Macintosh (which I get the
> feeling isn't the standard implementation :)).

What you currently find in the archive is very old. I have a working
version of 1.2 beta 3 which includes a socket library based on MacTCP
which sort of works (well I have *one* application that works).

Unfortunately I have less time than needed to iron out the warts from
this, in particularly making it more robust and documenting the
differences between "socket" on the Mac and "socket" on Unix. There
are also new modules that interface to the Mac toolbox (windows,
menus, quickdraw, the whole kaboodle) but again this is completely
undocumented and mostly untested so I'm afraid to release it to the
world. I have the feeling that the big problem here is actually
getting enough applications working so that I have a feeling for how
useful and complete it all is...

> According to the library documentation, the sockets library is not totally
> Mac-compatible (very unfortunate, though understandable). I suppose it's
> too much to hope that the CGI part of that library works with Mac? I was
> hoping to write MacHTTP CGIs in Python. An Apple Events library might also
> do the trick, though I didn't see one.

The main reason why I think that the current CGI library will be of
little use for the Mac is that it really is intended to be called from
an HTTP server. For the Mac you need a totally different interface
(maybe the entire server could be written in Python, and then a much
simpler interface than CGI could be used).

> More generally I'd be curious to know if anyone is successfully using
> Python with the Mac. It looks rather daunting, since the Mac
> implementation of Posix is so poor, and so many of the libraries seem to
> be unix oriented.

It depends on what you want to do. There is a portable subset of
Python which is quite powerful but unfortunately doesn't include much
in the area of user interfaces, and its networking is somewhat
limited. However I expect that as more native Mac primitives are
accessible from Python and compatibility libraries are developed, it
will find itself a niche for doing all sorts of little tasks -- e.g. I
already have a row of small Python scripts on my desktop that I can
drop files on to change their creator.

Drop me a note if you want to help develop Mac Python modules or want
to beta test it.

--Guido van Rossum, CWI, Amsterdam <mailto:Guido.van.Rossum@cwi.nl>
<http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>