blob: 5d706ce43b1c71fd1ae0f034c6d54802f8084a07 [file] [log] [blame]
Jack Jansena6308131996-03-18 13:38:52 +00001<HTML><HEAD><TITLE>Macintosh Python crash course</TITLE></HEAD>
2<BODY>
3<H1><IMG SRC="html.icons/python.gif">Macintosh Python crash course</H1>
4<HR>
5
6This set of documents provides an introduction to various aspects of
7Python programming on the Mac. It is assumed that the reader is
8already familiar with Python and, to some extent, with MacOS Toolbox
9programming. Other readers may find something interesting here too,
10your mileage may vary. <p>
11
Jack Jansen5f962c21996-04-10 14:52:59 +000012There is a companion document <a href="using.html">Using Python on the Mac</a>
13which you should read before starting here: it explains the basics of using
14python on the Macintosh. <p>
15
Jack Jansena6308131996-03-18 13:38:52 +000016Another set of Macintosh-savvy examples, more aimed at beginners, is
17maintained by Joseph Strout, at <A
18HREF="http://www-acs.ucsd.edu/~jstrout/python/">
19http://www-acs.ucsd.edu/~jstrout/python/</A>.
20<P>
21
Jack Jansen3412c5d1997-08-27 14:08:22 +000022The <a href="http://www.python.org/doc/lib/Top.html">Python Library
23Reference</a> contains a section on <a
24href="http://www.python.org/doc/lib/Macintosh-Specific-Services.html">Macintosh-specific
25modules</a> that you should also read. Documentation is also available
26in PostScript and other forms, see the <a
27href="http://www.python.org/doc/">documentation</a> section on the
28webserver. <p>
Jack Jansen024a3871996-07-18 16:07:05 +000029
Jack Jansen3412c5d1997-08-27 14:08:22 +000030Some of these documents were actually written a long time ago and have seen
31little maintainance, so use with care. <p>
Jack Jansena6308131996-03-18 13:38:52 +000032
Jack Jansena6308131996-03-18 13:38:52 +000033<H2>Table of contents</H2>
34
35<UL>
36<LI>
Jack Jansen024a3871996-07-18 16:07:05 +000037<A HREF="example0.html">Using python to create Macintosh applications,
38part zero</A> whets your appetite by showing you how to ask the user
39for a filename, and how to display a message. It explains about end-of-line
40confusion while doing so.
41
42<LI>
Jack Jansena6308131996-03-18 13:38:52 +000043<A HREF="example1.html">Using python to create Macintosh applications,
44part one</A> explains how to create a simple modal-dialog application
45in Python. It also takes a glance at using the toolbox modules Res and
46Dlg, and EasyDialogs for simple question-dialogs.
47
48<LI>
49<A HREF="example2.html">Using python to create Macintosh applications,
50part two</A> turns the previous example program into a more complete
51mac application, using a modeless dialog, menus, etc. It also explains
52how to create applets, standalone applications written in Python.
53
54<LI>
Jack Jansen08365421996-04-19 15:56:08 +000055<A HREF="textedit.html">Using FrameWork and TextEdit</A> shows you
56how to use <code>FrameWork</code> application framework and the
57<code>TextEdit</code> toolbox to build a text editor.
58
59<LI>
60<A HREF="waste.html">Using WASTE</A> expands on this editor by using
61WASTE, an extended TextEdit replacement.
Jack Jansena6308131996-03-18 13:38:52 +000062
63<LI>
64<A HREF="plugins.html">Creating a C extension module on the Macintosh</A>
65is meant for the hardcore programmer, and shows how to create an
66extension module in C. It also handles using Modulator to create the
67boilerplate for your module, and creating dynamically-loadable modules
68on PowerPC Macs.
69
70<LI>
71<A HREF="applescript.html">Using Open Scripting Architecture from Python</A> explains
72how to create a Python module interfacing to a scriptable application,
73and how to use that module in your python program.
Jack Jansen41222161996-05-20 11:32:49 +000074
75<LI>
Jack Jansen09da2091996-09-09 01:48:03 +000076<A HREF="cgi.html">Using python to create CGI scripts</A> is a preliminary
77introduction to writing CGI scripts in Python and to writing scriptable applications
78in Python.
79
80<LI>
Jack Jansen36389351996-08-07 13:19:16 +000081<A HREF="building.html">Building Mac Python from source</A> explains
Jack Jansen41222161996-05-20 11:32:49 +000082how to build a PPC or 68K interpreter from a source distribution.
Jack Jansen6ad8d131997-01-15 16:53:37 +000083
84<LI>
85<A HREF="embed.html">Embedding Python on the Mac</A> is a minimal example of
86how to embed Python in other Mac applications.
87
Jack Jansena2139fe1998-02-25 15:40:35 +000088<LI>
89<a href="standalone.html">Building Standalone applications in Python</a>
90explains how you can create real standalone applications in Python. You do
91need source (and a C development environment) for this at the moment.
92
Jack Jansena6308131996-03-18 13:38:52 +000093</UL>
94
Jack Jansen08365421996-04-19 15:56:08 +000095The Python distribution contains a few more examples, all unexplained:
96<UL>
97<LI>
98<I>PICTbrowse</I> is an application that locates PICT
99resources and displays them, it demonstrates some quickdraw and the
100resource and list managers.
101
102<LI>
103<I>Imgbrowse</I> displays image files in
104many different formats (gif, tiff, pbm, etc). It shows how to use the
105img modules on the mac.
106
107<LI>
108<I>Quicktime</I> has the standard <code>MovieInWindow</code> and
109<code>VerySimplePlayer</code> examples, re-coded in Python.
110
111<LI>
112<I>Resources</I>, <I>Sound</I> and <I>Speech</I> have some examples
Jack Jansena2139fe1998-02-25 15:40:35 +0000113on using the respective managers. In the <i>Mac:Lib</i> folder you
114will also find modules that do useful things with the Communications
115Toolbox, the Finder interface, etc.
Jack Jansen08365421996-04-19 15:56:08 +0000116</UL>
117
Jack Jansena6308131996-03-18 13:38:52 +0000118At some point in the (possibly distant) future, I will add chapters on
119how to use bgen to create modules completely automatic and how to make
120your Python program scriptable, but that will have to wait. <p>
121
122<HR>
123
124Please let me know if you miss critical information in this
125document. I am quite sure that I will never find the time to turn it
126into a complete MacPython programmers guide (which would probably be a
Jack Jansena2139fe1998-02-25 15:40:35 +0000127400-page book instead of 10 lousy html-files), but it should contain
Jack Jansena6308131996-03-18 13:38:52 +0000128at least the information that is neither in the standard Python
129documentation nor in Inside Mac or other Mac programmers
130documentation. <p>
131
132<HR>
133<A HREF="http://www.cwi.nl/~jack">Jack Jansen</A>,
Jack Jansena2139fe1998-02-25 15:40:35 +0000134<A HREF="mailto:jack@cwi.nl">jack@cwi.nl</A>, 25-Feb-98.
Jack Jansen024a3871996-07-18 16:07:05 +0000135</BODY></HTML>