| ★ wanayoo — archive 1999 http://www.cwi.nl/~jack/macpython.html | Nouvelle recherche | Portail wanayoo |
The only Special Interest Group I will mention here is the PythonMac SIG, which has discussions on Macintosh-specific aspects of Python.
Aside from the numerous extension modules available on most platforms (include the Tk windowing toolkit, sockets and many others) MacPython has a number of extension modules specifically for MacOS. MacPython programmers have access to QuickDraw, QuickTime, the Sound manager and various third party toolkits like Internet Config and Waste, to name but a few.
Also included is an integrated development environment by Just van Rossum, which includes an editor, debugger and class browser all closely integrated.
The full distributions below contain examples and some documentation on Mac-specific aspects of using Python. Documentation on the language and the standard library can be obtained at the Python website.
68K users should note that there are problems with the CFM68K version of MacPython (the preferred version for 68K users, giving access to dynamically loaded modules and applets), so it may be advisable to use the static 68K version. The readme file has details.
The installer is available in MacBinary format (about 9Mb) and BinHex format (about 11Mb). Use the latter installer if your browser mistreats MacBinary files (as many appear to do).
Note: The interpreter version number and the folder it installs into are rather strangely named Python1.5.2c1. Because the MacPython distribution has significantly lagged behind the general 1.5.2 release (just this once, we hope:-) fixing this would have meant a lot of work, and even more lag. Sorry for this.
Note 2: some problems have been reported reported when installing MacPython on iMacs if you have the Virex antivirus software running. Disabling Virex should help here.
Tambien, si puede leer espanol, MacWorld Espana tiene un curso de programacion en Python sobre el Mac. Esta seria comenza en el numero de julio/agosto 1998.
And if you don't read spanish you can safely ignore the paragraph above:-)
Note: The version of CWGUSI which is used to build MacPython is no longer distribution by Matthias Neeracher, and the newer CWGUSI 2 has not been tested for use with Python yet. Until this is resolved please use a Python-specific CWGUSI from ftp://ftp.cwi.nl/pub/jack/python/mac/CWGUSI-for-Python152.hqx.
As Corran Webster, cwebster@nevada.edu, reported recently it is not necessary to buy the CodeWarrior C compiler to write MacPython extension modules: in many case Apple's free MPW tools work just fine. See his Compiling Python modules with MPW page for details.
If you want a more recent source distribution than the latest full distribution but you can't use CVS access (see below) for some reason: occasionally I make a dump of the source tree, which you can find in ftp://ftp.cwi.nl/pub/jack/python/mac/SourceDump. The .tgz file is gzipped tar, which you should be able to unpack with StuffIt Expander. You are also responsible for unpacking all ".bin" files yourself, and for setting the creator/type of ".prj" files to CWIE/MMPR. Send me an email if you need a more recent version of this sourcedump, and if enough people bother me I'll make them automatically every night.
building.html document in the source
distribution and decide they want CVS access. You are not expected to
understand it (or be interested in it) if you haven't read that
document. The MacPython sources are also accessible through remote CVS, at
CVSROOT: ropython@trawler.cwi.nl:/hosts/mm/CVSREMOTE
Password: geheim
Authentication: pserver
Module: python/Mac
As stated in the building.html document: please use MacCVS from
www.wincvs.org, not MacCVS
Pro, which does not appear to work with the Python CVS archives. If you start using the CVS archive please send me a mail at jack@cwi.nl so I have some idea of how many people use it. It is also suggested that you subscribe to the MacPython CVS checkin mailing list.
The CVS repository for the libraries used by MacPython is
currently in a flux, it is suggested you just download these in
source form, as explained in building.html.
Using JPython now is really very easy. To install, just drop JPython1.1beta4.class onto the JBindery icon (you need the MRJ SDK to do this). They now have it set up so that you can just take the defaults to get InstallAnywhere going. Unfortunately, the save dialog that pops up to ask for the installation location is a little wierd. First of all, it defaults to your Preferences folder. Next, you have to tell it to "open" a file (any file) in the directory where you want JPython installed.Once you have JPython installed, you will want to make a JBindery app to have double-clickable file for starting the interpreter. Drop the jpython.jar file (from your chosen install directory) onto JBindery. Choose "org.python.core.jpython" for the "Class name" in the first panel. Set both stdin and stdout to be "message window." Click on "Classpath" and make sure jpython.jar is there. If not, you can either drag it in or use the "add .zip file" button to add it to the list. Click on "save settings...", choose "save as application" and you will have an icon that you can double-click to start the JPython interpreter.
To run a script, drop the JPython app you made from the instructions in the previous paragraph onto JBindery. Put the name of the file that you want to run in the "optional parameters" list and make sure that the folder containing your ".py" file is in the classpath (you can just drag your script file onto the list to get it there). Do the "save as application" again and you have a double-clickable icon that will run your script. I do this and then cycle through editing the script with the IDE or CodeWarrior or Alpha and double-clicking this icon to test my code.