Mercurial > cpython-lru_cache-weakref
annotate Doc/mac/using.tex @ 27998:e27f58a50737 legacy-trunk
SF bug #690377: Dud footnote reference in distutils docs
| author | Raymond Hettinger <python@rcn.com> |
|---|---|
| date | Fri, 21 Feb 2003 02:47:09 +0000 |
| parents | 523efd773261 |
| children | fd434beb5f56 |
| rev | line source |
|---|---|
|
27833
523efd773261
Updated the Mac documentation to the current state of affairs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
25862
diff
changeset
|
1 \chapter{Using Python on a Mac OS 9 Macintosh \label{using}} |
|
15229
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
2 \sectionauthor{Bob Savage}{bobsavage@mac.com} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
3 |
|
27833
523efd773261
Updated the Mac documentation to the current state of affairs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
25862
diff
changeset
|
4 Using Python on a Mac OS 9 Macintosh can seem like something completely |
|
15229
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
5 different than using it on a \UNIX-like or Windows system. Most of the |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
6 Python documentation, both the ``official'' documentation and |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
7 published books, describe only how Python is used on these systems, |
|
27833
523efd773261
Updated the Mac documentation to the current state of affairs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
25862
diff
changeset
|
8 causing confusion for the new user of MacPython-OS9. This chapter gives a |
|
15229
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
9 brief introduction to the specifics of using Python on a Macintosh. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
10 |
|
27833
523efd773261
Updated the Mac documentation to the current state of affairs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
25862
diff
changeset
|
11 Note that this chapter is mainly relevant to Mac OS 9: MacPython-OSX |
|
523efd773261
Updated the Mac documentation to the current state of affairs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
25862
diff
changeset
|
12 is a superset of a normal unix Python. While MacPython-OS9 runs fine |
|
523efd773261
Updated the Mac documentation to the current state of affairs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
25862
diff
changeset
|
13 on Mac OS X it is a better choice to use MacPython-OSX there. |
|
15229
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
14 |
|
27833
523efd773261
Updated the Mac documentation to the current state of affairs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
25862
diff
changeset
|
15 The section on the IDE (see Section \ref{IDE}) is relevant to MacPython-OSX |
|
523efd773261
Updated the Mac documentation to the current state of affairs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
25862
diff
changeset
|
16 too. |
|
523efd773261
Updated the Mac documentation to the current state of affairs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
25862
diff
changeset
|
17 |
|
523efd773261
Updated the Mac documentation to the current state of affairs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
25862
diff
changeset
|
18 \section{Getting and Installing MacPython-OS9 \label{getting}} |
|
15229
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
19 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
20 The most recent release version as well as possible newer experimental |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
21 versions are best found at the MacPython page maintained by Jack |
| 25862 | 22 Jansen: \url{http://www.cwi.nl/\textasciitilde jack/macpython.html}. |
|
15229
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
23 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
24 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
25 Please refer to the \file{README} included with your distribution for |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
26 the most up-to-date instructions. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
27 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
28 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
29 \section{Entering the interactive Interpreter |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
30 \label{interpreter}} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
31 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
32 The interactive interpreter that you will see used in Python |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
33 documentation is started by double-clicking the |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
34 \program{PythonInterpreter} icon, which looks like a 16-ton weight |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
35 falling. You should see the version information and the |
|
17500
5e99a1d0ea4d
Work around the conversion of ">>" and "<<" to guillemets. Reported by Ping.
Fred Drake <fdrake@acm.org>
parents:
15230
diff
changeset
|
36 \samp{>\code{>}>~} prompt. Use it exactly as described in the |
|
5e99a1d0ea4d
Work around the conversion of ">>" and "<<" to guillemets. Reported by Ping.
Fred Drake <fdrake@acm.org>
parents:
15230
diff
changeset
|
37 standard documentation. |
|
15229
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
38 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
39 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
40 \section{How to run a Python script} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
41 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
42 There are several ways to run an existing Python script; two common |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
43 ways to run a Python script are ``drag and drop'' and ``double |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
44 clicking''. Other ways include running it from within the IDE (see |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
45 Section \ref{IDE}), or launching via AppleScript. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
46 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
47 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
48 \subsection{Drag and drop} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
49 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
50 One of the easiest ways to launch a Python script is via ``Drag and |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
51 Drop''. This is just like launching a text file in the Finder by |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
52 ``dragging'' it over your word processor's icon and ``dropping'' it |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
53 there. Make sure that you use an icon referring to the |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
54 \program{PythonInterpreter}, not the \program{IDE} or \program{Idle} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
55 icons which have different behaviour which is described below. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
56 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
57 Some things that might have gone wrong: |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
58 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
59 \begin{itemize} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
60 \item |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
61 A window flashes after dropping the script onto the |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
62 \program{PythonInterpreter}, but then disappears. Most likely this is a |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
63 configuration issue; your \program{PythonInterpreter} is setup to exit |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
64 immediately upon completion, but your script assumes that if it prints |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
65 something that text will stick around for a while. To fix this, see |
|
15230
10b3cbdbdfd9
Fix some internal references that I botched.
Fred Drake <fdrake@acm.org>
parents:
15229
diff
changeset
|
66 section \ref{defaults}. |
|
15229
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
67 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
68 \item |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
69 When you waved the script icon over the \program{PythonInterpreter}, |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
70 the \program{PythonInterpreter} icon did not hilight. Most likely the |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
71 Creator code and document type is unset (or set incorrectly) -- this |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
72 often happens when a file originates on a non-Mac computer. See |
|
15230
10b3cbdbdfd9
Fix some internal references that I botched.
Fred Drake <fdrake@acm.org>
parents:
15229
diff
changeset
|
73 section \ref{creator-code} for more details. |
|
15229
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
74 \end{itemize} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
75 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
76 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
77 \subsection{Set Creator and Double Click \label{creator-code}} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
78 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
79 If the script that you want to launch has the appropriate Creator Code |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
80 and File Type you can simply double-click on the script to launch it. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
81 To be ``double-clickable'' a file needs to be of type \samp{TEXT}, |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
82 with a creator code of \samp{Pyth}. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
83 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
84 Setting the creator code and filetype can be done with the IDE (see |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
85 sections \ref{IDEwrite} and \ref{IDEapplet}), with an editor with a |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
86 Python mode (\program{BBEdit}) -- see section |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
87 \ref{scripting-with-BBedit}, or with assorted other Mac utilities, but |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
88 a script (\file{fixfiletypes.py}) has been included in the MacPython |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
89 distribution, making it possible to set the proper Type and Creator |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
90 Codes with Python. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
91 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
92 The \file{fixfiletypes.py} script will change the file type and |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
93 creator codes for the indicated directory. To use |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
94 \file{fixfiletypes.py}: |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
95 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
96 \begin{enumerate} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
97 \item |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
98 Locate it in the \file{scripts} folder of the \file{Mac} folder of the |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
99 MacPython distribution. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
100 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
101 \item |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
102 Put all of the scripts that you want to fix in a folder with nothing |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
103 else in it. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
104 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
105 \item |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
106 Double-click on the \file{fixfiletypes.py} icon. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
107 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
108 \item |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
109 Navigate into the folder of files you want to fix, and press the |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
110 ``Select current folder'' button. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
111 \end{enumerate} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
112 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
113 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
114 \section{Simulating command line arguments |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
115 \label{argv}} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
116 |
|
27833
523efd773261
Updated the Mac documentation to the current state of affairs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
25862
diff
changeset
|
117 There are two ways to simulate command-line arguments with MacPython-OS9. |
|
15229
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
118 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
119 \begin{enumerate} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
120 \item via Interpreter options |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
121 \begin{itemize} % nestable? I hope so! |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
122 \item Hold the option-key down when launching your script. This will |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
123 bring up a dialog box of Python Interpreter options. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
124 \item Click ``Set \UNIX-style command line..'' button. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
125 \item Type the arguments into the ``Argument'' field. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
126 \item Click ``OK'' |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
127 \item Click ``Run''. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
128 \end{itemize} % end |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
129 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
130 \item via drag and drop |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
131 If you save the script as an applet (see Section \ref{IDEapplet}), you |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
132 can also simulate some command-line arguments via |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
133 ``Drag-and-Drop''. In this case, the names of the files that were |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
134 dropped onto the applet will be appended to \code{sys.argv}, so that |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
135 it will appear to the script as though they had been typed on a |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
136 command line. As on \UNIX\ systems, the first item in \code{sys.srgv} is |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
137 the path to the applet, and the rest are the files dropped on the |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
138 applet. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
139 \end{enumerate} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
140 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
141 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
142 \section{Creating a Python script} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
143 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
144 Since Python scripts are simply text files, they can be created in any |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
145 way that text files can be created, but some special tools also exist |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
146 with extra features. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
147 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
148 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
149 \subsection{In an editor} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
150 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
151 You can create a text file with any word processing program such as |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
152 \program{MSWord} or \program{AppleWorks} but you need to make sure |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
153 that the file is saved as ``\ASCII'' or ``plain text''. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
154 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
155 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
156 \subsubsection{Editors with Python modes} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
157 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
158 Several text editors have additional features that add functionality |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
159 when you are creating a Python script. These can include coloring |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
160 Python keywords to make your code easier to read, module browsing, or |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
161 a built-in debugger. These include \program{Alpha}, \program{Pepper}, |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
162 and \program{BBedit}, and the MacPython IDE (Section \ref{IDE}). |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
163 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
164 %\subsubsection{Alpha} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
165 % **NEED INFO HERE** |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
166 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
167 \subsubsection{BBedit \label{scripting-with-BBedit}} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
168 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
169 If you use \program{BBEdit} to create your scripts you will want to tell it about the Python creator code so that |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
170 you can simply double click on the saved file to launch it. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
171 \begin{itemize} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
172 \item Launch \program{BBEdit}. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
173 \item Select ``Preferences'' from the ``Edit'' menu. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
174 \item Select ``File Types'' from the scrolling list. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
175 \item click on the ``Add...'' button and navigate to |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
176 \program{PythonInterpreter} in the main directory of the |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
177 MacPython distribution; click ``open''. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
178 \item Click on the ``Save'' button in the Preferences panel. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
179 \end{itemize} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
180 % Are there additional BBedit Python-specific features? I'm not aware of any. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
181 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
182 %\subsubsection{IDE} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
183 %You can use the \program{Python IDE} supplied in the MacPython Distribution to create longer Python scripts |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
184 %-- see Section \ref{IDEwrite} for details. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
185 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
186 %\subsubsection{IDLE} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
187 %Idle is an IDE for Python that was written in Python, using TKInter. You should be able to use it on a Mac by following |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
188 %the standard documentation, but see Section \ref{TKInter} for guidance on using TKInter with MacPython. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
189 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
190 %\subsubsection{Pepper} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
191 % **NEED INFO HERE** |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
192 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
193 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
194 \section{The IDE\label{IDE}} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
195 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
196 The \program{Python IDE} (Integrated Development Environment) is a |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
197 separate application that acts as a text editor for your Python code, |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
198 a class browser, a graphical debugger, and more. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
199 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
200 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
201 \subsection{Using the ``Python Interactive'' window} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
202 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
203 Use this window like you would the \program{PythonInterpreter}, except |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
204 that you cannot use the ``Drag and drop'' method above. Instead, |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
205 dropping a script onto the \program{Python IDE} icon will open the |
|
20821
ca418a5fa471
Correct misspelling of "separate" in two places.
Fred Drake <fdrake@acm.org>
parents:
17500
diff
changeset
|
206 file in a separate script window (which you can then execute manually |
|
15229
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
207 -- see section \ref{IDEexecution}). |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
208 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
209 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
210 \subsection{Writing a Python Script \label{IDEwrite}} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
211 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
212 In addition to using the \program{Python IDE} interactively, you can |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
213 also type out a complete Python program, saving it incrementally, and |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
214 execute it or smaller selections of it. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
215 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
216 You can create a new script, open a previously saved script, and save |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
217 your currently open script by selecting the appropriate item in the |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
218 ``File'' menu. Dropping a Python script onto the |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
219 \program{Python IDE} will open it for editting. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
220 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
221 If you try to open a script with the \program{Python IDE} but either |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
222 can't locate it from the ``Open'' dialog box, or you get an error |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
223 message like ``Can't open file of type ...'' see section |
|
15230
10b3cbdbdfd9
Fix some internal references that I botched.
Fred Drake <fdrake@acm.org>
parents:
15229
diff
changeset
|
224 \ref{creator-code}. |
|
15229
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
225 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
226 When the \program{Python IDE} saves a script, it uses the creator code |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
227 settings which are available by clicking on the small black triangle |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
228 on the top right of the document window, and selecting ``save |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
229 options''. The default is to save the file with the \program{Python |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
230 IDE} as the creator, this means that you can open the file for editing |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
231 by simply double-clicking on its icon. You might want to change this |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
232 behaviour so that it will be opened by the |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
233 \program{PythonInterpreter}, and run. To do this simply choose |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
234 ``Python Interpreter'' from the ``save options''. Note that these |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
235 options are associated with the \emph{file} not the application. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
236 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
237 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
238 \subsection{Executing a script from within the IDE |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
239 \label{IDEexecution}} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
240 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
241 You can run the script in the frontmost window of the \program{Python |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
242 IDE} by hitting the run all button. You should be aware, however that |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
243 if you use the Python convention \samp{if __name__ == "__main__":} the |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
244 script will \emph{not} be ``__main__'' by default. To get that |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
245 behaviour you must select the ``Run as __main__'' option from the |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
246 small black triangle on the top right of the document window. Note |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
247 that this option is associated with the \emph{file} not the |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
248 application. It \emph{will} stay active after a save, however; to shut |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
249 this feature off simply select it again. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
250 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
251 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
252 \subsection{``Save as'' versus ``Save as Applet'' |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
253 \label{IDEapplet}} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
254 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
255 When you are done writing your Python script you have the option of |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
256 saving it as an ``applet'' (by selecting ``Save as applet'' from the |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
257 ``File'' menu). This has a significant advantage in that you can drop |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
258 files or folders onto it, to pass them to the applet the way |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
259 command-line users would type them onto the command-line to pass them |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
260 as arguments to the script. However, you should make sure to save the |
|
20821
ca418a5fa471
Correct misspelling of "separate" in two places.
Fred Drake <fdrake@acm.org>
parents:
17500
diff
changeset
|
261 applet as a separate file, do not overwrite the script you are |
|
15229
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
262 writing, because you will not be able to edit it again. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
263 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
264 Accessing the items passed to the applet via ``drag-and-drop'' is done |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
265 using the standard \member{sys.argv} mechanism. See the general |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
266 documentation for more |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
267 % need to link to the appropriate place in non-Mac docs |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
268 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
269 Note that saving a script as an applet will not make it runnable on a |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
270 system without a Python installation. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
271 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
272 %\subsection{Debugger} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
273 % **NEED INFO HERE** |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
274 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
275 %\subsection{Module Browser} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
276 % **NEED INFO HERE** |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
277 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
278 %\subsection{Profiler} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
279 % **NEED INFO HERE** |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
280 % end IDE |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
281 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
282 %\subsection{The ``Scripts'' menu} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
283 % **NEED INFO HERE** |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
284 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
285 \section{Configuration \label{configuration}} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
286 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
287 The MacPython distribution comes with \program{EditPythonPrefs}, an |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
288 applet which will help you to customize the MacPython environment for |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
289 your working habits. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
290 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
291 \subsection{EditPythonPrefs\label{EditPythonPrefs}} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
292 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
293 \program{EditPythonPrefs} gives you the capability to configure Python |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
294 to behave the way you want it to. There are two ways to use |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
295 \program{EditPythonPrefs}, you can use it to set the preferences in |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
296 general, or you can drop a particular Python engine onto it to |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
297 customize only that version. The latter can be handy if, for example, |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
298 you want to have a second copy of the \program{PythonInterpreter} that |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
299 keeps the output window open on a normal exit even though you prefer |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
300 to normally not work that way. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
301 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
302 To change the default preferences, simply double-click on |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
303 \program{EditPythonPrefs}. To change the preferences only for one copy |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
304 of the Interpreter, drop the icon for that copy onto |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
305 \program{EditPythonPrefs}. You can also use \program{EditPythonPrefs} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
306 in this fashion to set the preferences of the \program{Python IDE} and |
|
15230
10b3cbdbdfd9
Fix some internal references that I botched.
Fred Drake <fdrake@acm.org>
parents:
15229
diff
changeset
|
307 any applets you create -- see section %s \ref{BuildApplet} and |
|
15229
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
308 \ref{IDEapplet}. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
309 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
310 \subsection{Adding modules to the Module Search Path |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
311 \label{search-path}} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
312 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
313 When executing an \keyword{import} statement, Python looks for modules |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
314 in places defined by the \member{sys.path} To edit the |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
315 \member{sys.path} on a Mac, launch \program{EditPythonPrefs}, and |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
316 enter them into the largish field at the top (one per line). |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
317 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
318 Since MacPython defines a main Python directory, the easiest thing is |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
319 to add folders to search within the main Python directory. To add a |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
320 folder of scripts that you created called ``My Folder'' located in the |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
321 main Python Folder, enter \samp{\$(PYTHON):My Folder} onto a new line. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
322 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
323 To add the Desktop under OS 9 or below, add |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
324 \samp{StartupDriveName:Desktop Folder} on a new line. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
325 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
326 \subsection{Default startup options \label{defaults}} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
327 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
328 % I'm assuming that there exists some other documentation on the |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
329 % rest of the options so I only go over a couple here. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
330 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
331 The ``Default startup options...'' button in the |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
332 \program{EditPythonPrefs} dialog box gives you many options including |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
333 the ability to keep the ``Output'' window open after the script |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
334 terminates, and the ability to enter interactive mode after the |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
335 termination of the run script. The latter can be very helpful if you |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
336 want to examine the objects that were created during your script. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
337 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
338 %\section{Nifty Tools} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
339 %There are many other tools included with the MacPython |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
340 %distribution. In addition to those discussed here, make |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
341 %sure to check the \file{Mac} directory. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
342 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
343 %\subsection{BuildApplet \label{BuildApplet}} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
344 % **NEED INFO HERE** |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
345 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
346 %\subsection{BuildApplication} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
347 % **NEED INFO HERE** |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
348 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
349 %\section{TKInter on the Mac \label{TKInter}} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
350 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
351 %TKinter is installed by default with the MacPython distribution, but |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
352 %you may need to add the \file{lib-tk} folder to the Python Path (see |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
353 %section \ref{search-path}). Also, it is important that you do not |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
354 %try to launch Tk from within the \program{Python IDE} because the two |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
355 %event loops will collide -- always run a script which uses Tkinter |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
356 %with the \program{PythonInterpreter} instead -- see section |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
357 %\ref{interpreter}. |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
358 |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
359 %\section{CGI on the Mac with Python \label{CGI}} |
|
bd88df20da2f
Chapter on how to use MacPython, by Bob Savage <bobsavage@mac.com>.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
360 %**NEED INFO HERE** |
