/Mac/Demo/index.html

http://unladen-swallow.googlecode.com/ · HTML · 156 lines · 127 code · 29 blank · 0 comment · 0 complexity · 20c4e5d6c35077547106a2010bb405b5 MD5 · raw file

  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. <p>This set of documents provides an introduction to various aspects of
  6. Python programming on the Mac. It is assumed that the reader is
  7. already familiar with Python and, to some extent, with MacOS Toolbox
  8. programming. Other readers may find something interesting here too,
  9. your mileage may vary. </p>
  10. <p>As the previous paragraph reveals to the careful observer these examples
  11. are dated, most of them were writting before OSX and haven't been updated
  12. afterwards. They still show how to use the Carbon wrappers but aren't
  13. necessarily the best way to use the Carbon API's in OSX.</p>
  14. Another set of Macintosh-savvy examples, more aimed at beginners, is
  15. maintained by Joseph Strout, at Python Tidbits in <A
  16. HREF="http://www.strout.net/python/">
  17. http://www.strout.net/python/</A>.
  18. <P>
  19. The <a href="http://www.python.org/doc/lib/Top.html">Python Library
  20. Reference</a> contains a section on <a
  21. href="http://www.python.org/doc/lib/Macintosh-Specific-Services.html">Macintosh-specific
  22. modules</a> that you should also read. Documentation is also available
  23. in PostScript and other forms, see the <a
  24. href="http://www.python.org/doc/">documentation</a> section on the
  25. webserver. <p>
  26. <p>The W widget set by Just van Rossum, does not have complete documentation as
  27. of this writing, but Corran Webster has documented most of it on his
  28. <A HREF="http://www.nevada.edu/~cwebster/Python/">Python Page</A>.</p>
  29. There are also some documentation links, as well as other MacPython-related
  30. pages, in the
  31. <A HREF="http://dmoz.org/Computers/Systems/Macintosh/Development/Scripting/Python/">
  32. Open Directory</A>.
  33. <H2>Table of contents</H2>
  34. <blockquote><B>Note:</B>
  35. Some of these documents were actually written a long time ago and have seen
  36. little maintainance, so use with care. </blockquote>
  37. <UL>
  38. <LI>
  39. <A HREF="example0.html">Using python to create Macintosh applications,
  40. part zero</A> whets your appetite by showing you how to ask the user
  41. for a filename, and how to display a message. It explains about end-of-line
  42. confusion while doing so.
  43. <LI>
  44. <A HREF="example1.html">Using python to create Macintosh applications,
  45. part one</A> explains how to create a simple modal-dialog application
  46. in Python. It also takes a glance at using the toolbox modules Res and
  47. Dlg, and EasyDialogs for simple question-dialogs.
  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. <LI>
  54. <A HREF="freezing.html">Freezing Python programs</A> extends on this concept,
  55. and shows you how to create applications that can be used on machines without
  56. a full Python installed. This one is probably best skipped on first contact
  57. with MacPython.
  58. <LI>
  59. <A HREF="textedit.html">Using FrameWork and TextEdit</A> shows you
  60. how to use <code>FrameWork</code> application framework and the
  61. <code>TextEdit</code> toolbox to build a text editor.
  62. <LI>
  63. <A HREF="plugins.html">Creating a C extension module on the Macintosh</A>
  64. is meant for the hardcore programmer, and shows how to create an
  65. extension module in C. It also handles using Modulator to create the
  66. boilerplate for your module, and creating dynamically-loadable modules
  67. on PowerPC Macs. It assumes you use CodeWarrior for you development.
  68. <LI>
  69. <A HREF="mpwextensions.html">Creating C extension modules using MPW</A>
  70. is a companion document, written by Corran Webster, which explains how you
  71. can develop Python extensions using Apple's free MPW compiler environment.
  72. <LI>
  73. <A HREF="applescript.html">Using Open Scripting Architecture from Python</A> explains
  74. how to create a Python module interfacing to a scriptable application,
  75. and how to use that module in your python program.
  76. <LI>
  77. <A HREF="cgi.html">Using python to create CGI scripts</A> is a preliminary
  78. introduction to writing CGI scripts in Python and to writing scriptable applications
  79. in Python.
  80. <LI>
  81. <A HREF="building.html">Building Mac Python from source</A> explains
  82. how to build a PPC or 68K interpreter from a source distribution.
  83. <LI>
  84. <A HREF="embed.html">Embedding Python on the Mac</A> is a minimal example of
  85. how to embed Python in other Mac applications.
  86. </UL>
  87. The Python distribution contains a few more examples, all unexplained:
  88. <UL>
  89. <LI>
  90. <I>PICTbrowse</I> is an application that locates PICT
  91. resources and displays them, it demonstrates some quickdraw and the
  92. resource and list managers. In the same folder you will find the very
  93. similar scripts ICONbrowse and cicnbrowse. oldPICTbrowse is the same program
  94. but form the pre-Appearance era, it uses a dialog with a user item and
  95. creates and manages its own List object.
  96. <LI>
  97. <I>Imgbrowse</I> displays image files in
  98. many different formats (gif, tiff, pbm, etc). It shows how to use the
  99. img modules on the mac.
  100. <LI>
  101. <I>Quicktime</I> has the standard <code>MovieInWindow</code> and
  102. <code>VerySimplePlayer</code> examples, re-coded in Python.
  103. <LI>
  104. <I>Resources</I>, <I>Sound</I> and <I>Speech</I> have some examples
  105. on using the respective managers. In the <i>Mac:Lib</i> folder you
  106. will also find modules that do useful things with the Communications
  107. Toolbox, the Finder interface, etc.
  108. <LI>
  109. <I>Printing</I> has an example on using the Printing module to, you guessed
  110. it, print from Python. The code is somewhat self-documenting. Donated
  111. by Just van Rossum, who also donated the Printing module itself.
  112. </UL>
  113. At some point in the (possibly distant) future, I will add chapters on
  114. how to use bgen to create modules completely automatic and how to make
  115. your Python program scriptable, but that will have to wait. <p>
  116. <HR>
  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 10 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. <HR>
  125. <A HREF="http://www.cwi.nl/~jack">Jack Jansen</A>,
  126. <A HREF="mailto:jack@cwi.nl">jack@cwi.nl</A>, 22-Apr-00.
  127. </BODY></HTML>