annotate Mac/Demo/index.html @ 4566:6403c94de50d legacy-trunk

Added safeguard against failure in __del__.
author Guido van Rossum <guido@python.org>
date Wed, 27 Nov 1996 19:39:58 +0000
parents 1ce00cdc003d
children 5ded2bc1908b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3457
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1 <HTML><HEAD><TITLE>Macintosh Python crash course</TITLE></HEAD>
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2 <BODY>
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3 <H1><IMG SRC="html.icons/python.gif">Macintosh Python crash course</H1>
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4 <HR>
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
5
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
6 This set of documents provides an introduction to various aspects of
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
7 Python programming on the Mac. It is assumed that the reader is
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
8 already familiar with Python and, to some extent, with MacOS Toolbox
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
9 programming. Other readers may find something interesting here too,
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
10 your mileage may vary. <p>
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
11
3505
f6bd57dbd524 Added a tutorial
Jack Jansen <jack.jansen@cwi.nl>
parents: 3457
diff changeset
12 There is a companion document <a href="using.html">Using Python on the Mac</a>
f6bd57dbd524 Added a tutorial
Jack Jansen <jack.jansen@cwi.nl>
parents: 3457
diff changeset
13 which you should read before starting here: it explains the basics of using
f6bd57dbd524 Added a tutorial
Jack Jansen <jack.jansen@cwi.nl>
parents: 3457
diff changeset
14 python on the Macintosh. <p>
f6bd57dbd524 Added a tutorial
Jack Jansen <jack.jansen@cwi.nl>
parents: 3457
diff changeset
15
3457
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
16 Another set of Macintosh-savvy examples, more aimed at beginners, is
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
17 maintained by Joseph Strout, at <A
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
18 HREF="http://www-acs.ucsd.edu/~jstrout/python/">
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
19 http://www-acs.ucsd.edu/~jstrout/python/</A>.
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
20 <P>
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
21
3751
2db6363459ca - Added a file dialog example
Jack Jansen <jack.jansen@cwi.nl>
parents: 3568
diff changeset
22 The <a href="http://www.python.org/doc/lib/Top.html">Python Library Reference</a> contains a section on
2db6363459ca - Added a file dialog example
Jack Jansen <jack.jansen@cwi.nl>
parents: 3568
diff changeset
23 <a href="http://www.python.org/doc/lib/Macintosh-Specific-Services.html">Macintosh-specific modules</a>
2db6363459ca - Added a file dialog example
Jack Jansen <jack.jansen@cwi.nl>
parents: 3568
diff changeset
24 that you should also read. Documentation is also available in PostScript and other
2db6363459ca - Added a file dialog example
Jack Jansen <jack.jansen@cwi.nl>
parents: 3568
diff changeset
25 forms, see the <a href="http://www.python.org/doc/">documentation</a> section
2db6363459ca - Added a file dialog example
Jack Jansen <jack.jansen@cwi.nl>
parents: 3568
diff changeset
26 on the webserver. <p>
2db6363459ca - Added a file dialog example
Jack Jansen <jack.jansen@cwi.nl>
parents: 3568
diff changeset
27
3531
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
28 Some of these documents were actually written while I was working on a "real"
3457
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
29 project: creating a single-button application that will allow my
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
30 girlfriend to read her mail (which actually pass thry <EM>my</EM>
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
31 mailbox, so I get to read it too, but don't tell her:-) without her
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
32 having to worry about internet connections, unix commands, etc. The
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
33 application, when finished, will connect to the net using InterSLIP,
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
34 start a (pseudo-)POP server on unix using rsh and use AppleScript to
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
35 tell Eudora to connect to that server and retrieve messages. <p>
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
36
3568
6de44d966292 Modified for 1.3.3 distribution
Jack Jansen <jack.jansen@cwi.nl>
parents: 3531
diff changeset
37 These examples were all built using Python 1.3.3, which can be downloaded
6de44d966292 Modified for 1.3.3 distribution
Jack Jansen <jack.jansen@cwi.nl>
parents: 3531
diff changeset
38 from <a href="ftp://ftp.cwi.nl/pub/jack/python/mac">ftp.cwi.nl, directory
6de44d966292 Modified for 1.3.3 distribution
Jack Jansen <jack.jansen@cwi.nl>
parents: 3531
diff changeset
39 /pub/jack/python/mac</a>, and possibly from the <a href="ftp://ftp.python/org">
6de44d966292 Modified for 1.3.3 distribution
Jack Jansen <jack.jansen@cwi.nl>
parents: 3531
diff changeset
40 ftp.python.org</a> server and its mirrors as well. Some examples may work
6de44d966292 Modified for 1.3.3 distribution
Jack Jansen <jack.jansen@cwi.nl>
parents: 3531
diff changeset
41 with earlier versions of Python, some will definitely not.
3457
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
42 <H2>Table of contents</H2>
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
43
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
44 <UL>
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
45 <LI>
3751
2db6363459ca - Added a file dialog example
Jack Jansen <jack.jansen@cwi.nl>
parents: 3568
diff changeset
46 <A HREF="example0.html">Using python to create Macintosh applications,
2db6363459ca - Added a file dialog example
Jack Jansen <jack.jansen@cwi.nl>
parents: 3568
diff changeset
47 part zero</A> whets your appetite by showing you how to ask the user
2db6363459ca - Added a file dialog example
Jack Jansen <jack.jansen@cwi.nl>
parents: 3568
diff changeset
48 for a filename, and how to display a message. It explains about end-of-line
2db6363459ca - Added a file dialog example
Jack Jansen <jack.jansen@cwi.nl>
parents: 3568
diff changeset
49 confusion while doing so.
2db6363459ca - Added a file dialog example
Jack Jansen <jack.jansen@cwi.nl>
parents: 3568
diff changeset
50
2db6363459ca - Added a file dialog example
Jack Jansen <jack.jansen@cwi.nl>
parents: 3568
diff changeset
51 <LI>
3457
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
52 <A HREF="example1.html">Using python to create Macintosh applications,
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
53 part one</A> explains how to create a simple modal-dialog application
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
54 in Python. It also takes a glance at using the toolbox modules Res and
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
55 Dlg, and EasyDialogs for simple question-dialogs.
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
56
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
57 <LI>
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
58 <A HREF="example2.html">Using python to create Macintosh applications,
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
59 part two</A> turns the previous example program into a more complete
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
60 mac application, using a modeless dialog, menus, etc. It also explains
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
61 how to create applets, standalone applications written in Python.
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
62
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
63 <LI>
3531
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
64 <A HREF="textedit.html">Using FrameWork and TextEdit</A> shows you
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
65 how to use <code>FrameWork</code> application framework and the
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
66 <code>TextEdit</code> toolbox to build a text editor.
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
67
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
68 <LI>
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
69 <A HREF="waste.html">Using WASTE</A> expands on this editor by using
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
70 WASTE, an extended TextEdit replacement.
3457
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
71
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
72 <LI>
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
73 <A HREF="plugins.html">Creating a C extension module on the Macintosh</A>
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
74 is meant for the hardcore programmer, and shows how to create an
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
75 extension module in C. It also handles using Modulator to create the
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
76 boilerplate for your module, and creating dynamically-loadable modules
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
77 on PowerPC Macs.
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
78
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
79 <LI>
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
80 <A HREF="applescript.html">Using Open Scripting Architecture from Python</A> explains
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
81 how to create a Python module interfacing to a scriptable application,
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
82 and how to use that module in your python program.
3568
6de44d966292 Modified for 1.3.3 distribution
Jack Jansen <jack.jansen@cwi.nl>
parents: 3531
diff changeset
83
6de44d966292 Modified for 1.3.3 distribution
Jack Jansen <jack.jansen@cwi.nl>
parents: 3531
diff changeset
84 <LI>
4243
1ce00cdc003d Added ref to cgi.html
Jack Jansen <jack.jansen@cwi.nl>
parents: 3946
diff changeset
85 <A HREF="cgi.html">Using python to create CGI scripts</A> is a preliminary
1ce00cdc003d Added ref to cgi.html
Jack Jansen <jack.jansen@cwi.nl>
parents: 3946
diff changeset
86 introduction to writing CGI scripts in Python and to writing scriptable applications
1ce00cdc003d Added ref to cgi.html
Jack Jansen <jack.jansen@cwi.nl>
parents: 3946
diff changeset
87 in Python.
1ce00cdc003d Added ref to cgi.html
Jack Jansen <jack.jansen@cwi.nl>
parents: 3946
diff changeset
88
1ce00cdc003d Added ref to cgi.html
Jack Jansen <jack.jansen@cwi.nl>
parents: 3946
diff changeset
89 <LI>
3946
6f78d3164376 Moved build.html to building.html
Jack Jansen <jack.jansen@cwi.nl>
parents: 3751
diff changeset
90 <A HREF="building.html">Building Mac Python from source</A> explains
3568
6de44d966292 Modified for 1.3.3 distribution
Jack Jansen <jack.jansen@cwi.nl>
parents: 3531
diff changeset
91 how to build a PPC or 68K interpreter from a source distribution.
3457
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
92 </UL>
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
93
3531
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
94 The Python distribution contains a few more examples, all unexplained:
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
95 <UL>
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
96 <LI>
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
97 <I>PICTbrowse</I> is an application that locates PICT
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
98 resources and displays them, it demonstrates some quickdraw and the
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
99 resource and list managers.
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
100
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
101 <LI>
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
102 <I>Imgbrowse</I> displays image files in
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
103 many different formats (gif, tiff, pbm, etc). It shows how to use the
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
104 img modules on the mac.
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
105
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
106 <LI>
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
107 <I>Quicktime</I> has the standard <code>MovieInWindow</code> and
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
108 <code>VerySimplePlayer</code> examples, re-coded in Python.
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
109
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
110 <LI>
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
111 <I>Resources</I>, <I>Sound</I> and <I>Speech</I> have some examples
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
112 on using the respective managers.
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
113 </UL>
38e1480e7f89 Added documentation on FrameWork, TextEdit and Waste
Jack Jansen <jack.jansen@cwi.nl>
parents: 3505
diff changeset
114
3457
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
115 At some point in the (possibly distant) future, I will add chapters on
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
116 how to use bgen to create modules completely automatic and how to make
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
117 your Python program scriptable, but that will have to wait. <p>
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
118
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
119 <HR>
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
120
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
121 Please let me know if you miss critical information in this
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
122 document. I am quite sure that I will never find the time to turn it
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
123 into a complete MacPython programmers guide (which would probably be a
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
124 400-page book instead of 5 lousy html-files), but it should contain
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
125 at least the information that is neither in the standard Python
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
126 documentation nor in Inside Mac or other Mac programmers
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
127 documentation. <p>
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
128
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
129 <HR>
a71d2fd90fa8 Explanations of the examples here
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
130 <A HREF="http://www.cwi.nl/~jack">Jack Jansen</A>,
4243
1ce00cdc003d Added ref to cgi.html
Jack Jansen <jack.jansen@cwi.nl>
parents: 3946
diff changeset
131 <A HREF="mailto:jack@cwi.nl">jack@cwi.nl</A>, 09-September-1996.
3751
2db6363459ca - Added a file dialog example
Jack Jansen <jack.jansen@cwi.nl>
parents: 3568
diff changeset
132 </BODY></HTML>