| Jack Jansen | a630813 | 1996-03-18 13:38:52 +0000 | [diff] [blame] | 1 | <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 |  | 
|  | 6 | This set of documents provides an introduction to various aspects of | 
|  | 7 | Python programming on the Mac. It is assumed that the reader is | 
|  | 8 | already familiar with Python and, to some extent, with MacOS Toolbox | 
|  | 9 | programming. Other readers may find something interesting here too, | 
|  | 10 | your mileage may vary. <p> | 
|  | 11 |  | 
| Jack Jansen | 5f962c2 | 1996-04-10 14:52:59 +0000 | [diff] [blame] | 12 | There is a companion document <a href="using.html">Using Python on the Mac</a> | 
|  | 13 | which you should read before starting here: it explains the basics of using | 
|  | 14 | python on the Macintosh. <p> | 
|  | 15 |  | 
| Jack Jansen | a630813 | 1996-03-18 13:38:52 +0000 | [diff] [blame] | 16 | Another set of Macintosh-savvy examples, more aimed at beginners, is | 
|  | 17 | maintained by Joseph Strout, at <A | 
|  | 18 | HREF="http://www-acs.ucsd.edu/~jstrout/python/"> | 
|  | 19 | http://www-acs.ucsd.edu/~jstrout/python/</A>. | 
|  | 20 | <P> | 
|  | 21 |  | 
| Jack Jansen | 3412c5d | 1997-08-27 14:08:22 +0000 | [diff] [blame^] | 22 | The <a href="http://www.python.org/doc/lib/Top.html">Python Library | 
|  | 23 | Reference</a> contains a section on <a | 
|  | 24 | href="http://www.python.org/doc/lib/Macintosh-Specific-Services.html">Macintosh-specific | 
|  | 25 | modules</a> that you should also read. Documentation is also available | 
|  | 26 | in PostScript and other forms, see the <a | 
|  | 27 | href="http://www.python.org/doc/">documentation</a> section on the | 
|  | 28 | webserver. <p> | 
| Jack Jansen | 024a387 | 1996-07-18 16:07:05 +0000 | [diff] [blame] | 29 |  | 
| Jack Jansen | 3412c5d | 1997-08-27 14:08:22 +0000 | [diff] [blame^] | 30 | Some of these documents were actually written a long time ago and have seen | 
|  | 31 | little maintainance, so use with care. <p> | 
| Jack Jansen | a630813 | 1996-03-18 13:38:52 +0000 | [diff] [blame] | 32 |  | 
| Jack Jansen | a630813 | 1996-03-18 13:38:52 +0000 | [diff] [blame] | 33 | <H2>Table of contents</H2> | 
|  | 34 |  | 
|  | 35 | <UL> | 
|  | 36 | <LI> | 
| Jack Jansen | 024a387 | 1996-07-18 16:07:05 +0000 | [diff] [blame] | 37 | <A HREF="example0.html">Using python to create Macintosh applications, | 
|  | 38 | part zero</A> whets your appetite by showing you how to ask the user | 
|  | 39 | for a filename, and how to display a message. It explains about end-of-line | 
|  | 40 | confusion while doing so. | 
|  | 41 |  | 
|  | 42 | <LI> | 
| Jack Jansen | a630813 | 1996-03-18 13:38:52 +0000 | [diff] [blame] | 43 | <A HREF="example1.html">Using python to create Macintosh applications, | 
|  | 44 | part one</A> explains how to create a simple modal-dialog application | 
|  | 45 | in Python. It also takes a glance at using the toolbox modules Res and | 
|  | 46 | Dlg, and EasyDialogs for simple question-dialogs. | 
|  | 47 |  | 
|  | 48 | <LI> | 
|  | 49 | <A HREF="example2.html">Using python to create Macintosh applications, | 
|  | 50 | part two</A> turns the previous example program into a more complete | 
|  | 51 | mac application, using a modeless dialog, menus, etc. It also explains | 
|  | 52 | how to create applets, standalone applications written in Python. | 
|  | 53 |  | 
|  | 54 | <LI> | 
| Jack Jansen | 0836542 | 1996-04-19 15:56:08 +0000 | [diff] [blame] | 55 | <A HREF="textedit.html">Using FrameWork and TextEdit</A> shows you | 
|  | 56 | how 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 | 
|  | 61 | WASTE, an extended TextEdit replacement. | 
| Jack Jansen | a630813 | 1996-03-18 13:38:52 +0000 | [diff] [blame] | 62 |  | 
|  | 63 | <LI> | 
|  | 64 | <A HREF="plugins.html">Creating a C extension module on the Macintosh</A> | 
|  | 65 | is meant for the hardcore programmer, and shows how to create an | 
|  | 66 | extension module in C. It also handles using Modulator to create the | 
|  | 67 | boilerplate for your module, and creating dynamically-loadable modules | 
|  | 68 | on PowerPC Macs. | 
|  | 69 |  | 
|  | 70 | <LI> | 
|  | 71 | <A HREF="applescript.html">Using Open Scripting Architecture from Python</A> explains | 
|  | 72 | how to create a Python module interfacing to a scriptable application, | 
|  | 73 | and how to use that module in your python program. | 
| Jack Jansen | 4122216 | 1996-05-20 11:32:49 +0000 | [diff] [blame] | 74 |  | 
|  | 75 | <LI> | 
| Jack Jansen | 09da209 | 1996-09-09 01:48:03 +0000 | [diff] [blame] | 76 | <A HREF="cgi.html">Using python to create CGI scripts</A> is a preliminary | 
|  | 77 | introduction to writing CGI scripts in Python and to writing scriptable applications | 
|  | 78 | in Python. | 
|  | 79 |  | 
|  | 80 | <LI> | 
| Jack Jansen | 3638935 | 1996-08-07 13:19:16 +0000 | [diff] [blame] | 81 | <A HREF="building.html">Building Mac Python from source</A> explains | 
| Jack Jansen | 4122216 | 1996-05-20 11:32:49 +0000 | [diff] [blame] | 82 | how to build a PPC or 68K interpreter from a source distribution. | 
| Jack Jansen | 6ad8d13 | 1997-01-15 16:53:37 +0000 | [diff] [blame] | 83 |  | 
|  | 84 | <LI> | 
|  | 85 | <A HREF="embed.html">Embedding Python on the Mac</A> is a minimal example of | 
|  | 86 | how to embed Python in other Mac applications. | 
|  | 87 |  | 
| Jack Jansen | a630813 | 1996-03-18 13:38:52 +0000 | [diff] [blame] | 88 | </UL> | 
|  | 89 |  | 
| Jack Jansen | 0836542 | 1996-04-19 15:56:08 +0000 | [diff] [blame] | 90 | The Python distribution contains a few more examples, all unexplained: | 
|  | 91 | <UL> | 
|  | 92 | <LI> | 
|  | 93 | <I>PICTbrowse</I> is an application that locates PICT | 
|  | 94 | resources and displays them, it demonstrates some quickdraw and the | 
|  | 95 | resource and list managers. | 
|  | 96 |  | 
|  | 97 | <LI> | 
|  | 98 | <I>Imgbrowse</I> displays image files in | 
|  | 99 | many different formats (gif, tiff, pbm, etc). It shows how to use the | 
|  | 100 | img modules on the mac. | 
|  | 101 |  | 
|  | 102 | <LI> | 
|  | 103 | <I>Quicktime</I> has the standard <code>MovieInWindow</code> and | 
|  | 104 | <code>VerySimplePlayer</code> examples, re-coded in Python. | 
|  | 105 |  | 
|  | 106 | <LI> | 
|  | 107 | <I>Resources</I>, <I>Sound</I> and <I>Speech</I> have some examples | 
|  | 108 | on using the respective managers. | 
|  | 109 | </UL> | 
|  | 110 |  | 
| Jack Jansen | a630813 | 1996-03-18 13:38:52 +0000 | [diff] [blame] | 111 | At some point in the (possibly distant) future, I will add chapters on | 
|  | 112 | how to use bgen to create modules completely automatic and how to make | 
|  | 113 | your Python program scriptable, but that will have to wait. <p> | 
|  | 114 |  | 
|  | 115 | <HR> | 
|  | 116 |  | 
|  | 117 | Please let me know if you miss critical information in this | 
|  | 118 | document. I am quite sure that I will never find the time to turn it | 
|  | 119 | into a complete MacPython programmers guide (which would probably be a | 
|  | 120 | 400-page book instead of 5 lousy html-files), but it should contain | 
|  | 121 | at least the information that is neither in the standard Python | 
|  | 122 | documentation nor in Inside Mac or other Mac programmers | 
|  | 123 | documentation. <p> | 
|  | 124 |  | 
|  | 125 | <HR> | 
|  | 126 | <A HREF="http://www.cwi.nl/~jack">Jack Jansen</A>, | 
| Jack Jansen | 3412c5d | 1997-08-27 14:08:22 +0000 | [diff] [blame^] | 127 | <A HREF="mailto:jack@cwi.nl">jack@cwi.nl</A>, 27-Aug-97. | 
| Jack Jansen | 024a387 | 1996-07-18 16:07:05 +0000 | [diff] [blame] | 128 | </BODY></HTML> |