Mercurial > cpython-lru_cache-weakref
annotate Mac/Demo/embed.html @ 5817:48b94de85bf3 legacy-trunk
Extensive changes by AMK.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Thu, 17 Jul 1997 16:29:42 +0000 |
| parents | 5ded2bc1908b |
| children | 9a3e6f0d6b5a |
| rev | line source |
|---|---|
|
4963
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
1 <HTML> |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
2 <HEAD> |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
3 <TITLE>Embedding Python on the Mac</TITLE> |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
4 </HEAD> |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
5 <BODY> |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
6 <H1>Embedding Python on the Mac</H1> |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
7 <HR> |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
8 |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
9 Embedding Python on the mac is pretty similar to embedding it on other |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
10 platforms, but a few points need mentioning: |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
11 |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
12 <UL> |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
13 <LI> You call <CODE>PyMac_Initialize()</CODE> in stead of |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
14 <CODE>Py_Initialize()</CODE>. The prototype is in <CODE>macglue.h</CODE>. |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
15 This call initializes the toolbox, GUSI (if needed), sets up the correct |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
16 resource files and calls Py_Initialize. |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
17 |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
18 <LI> You have to be consequent in your use of GUSI. If the library uses |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
19 it so should your program and vice versa. |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
20 |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
21 <LI> The console-behaviour (close-on-exit, etc) is controlled by Python, |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
22 but you are of course free to change that after calling PyMac_Initialize(). |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
23 </UL> |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
24 |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
25 The Python environment is started with a dummy argc and argv, and initial |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
26 startup options are obtained through the usual means, except that the |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
27 user pression the option-key will not result in an interactive dialog. |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
28 You can, however, set startup options on your program in the same way as you |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
29 do for applets, by dragging your application to <code>EditPythonPrefs</code>. <p> |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
30 |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
31 The most logical way to embed Python is to link it against the shared library |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
32 <code>PythonCorePPC</code> or <code>PythonCoreCFM68K</code>. An example project |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
33 and source can be found in the <a href="embed">embed</a> folder. |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
34 |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
35 </BODY> |
|
5ded2bc1908b
"ported" Guido's embedding demo to the mac, and wrote some minimal
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
36 </HTML> |
