blob: 934619b968e6617aa5d02ee0051723b50a061b38 [file] [log] [blame]
Jack Jansen6ad8d131997-01-15 16:53:37 +00001<HTML>
2<HEAD>
3<TITLE>Embedding Python on the Mac</TITLE>
4</HEAD>
5<BODY>
6<H1>Embedding Python on the Mac</H1>
7<HR>
8
9Embedding Python on the mac is pretty similar to embedding it on other
10platforms, but a few points need mentioning:
11
12<UL>
13<LI> You call <CODE>PyMac_Initialize()</CODE> in stead of
14<CODE>Py_Initialize()</CODE>. The prototype is in <CODE>macglue.h</CODE>.
15This call initializes the toolbox, GUSI (if needed), sets up the correct
16resource files and calls Py_Initialize.
17
18<LI> You have to be consequent in your use of GUSI. If the library uses
19it so should your program and vice versa.
20
21<LI> The console-behaviour (close-on-exit, etc) is controlled by Python,
22but you are of course free to change that after calling PyMac_Initialize().
23</UL>
24
25The Python environment is started with a dummy argc and argv, and initial
26startup options are obtained through the usual means, except that the
27user pression the option-key will not result in an interactive dialog.
28You can, however, set startup options on your program in the same way as you
29do for applets, by dragging your application to <code>EditPythonPrefs</code>. <p>
30
31The most logical way to embed Python is to link it against the shared library
32<code>PythonCorePPC</code> or <code>PythonCoreCFM68K</code>. An example project
33and source can be found in the <a href="embed">embed</a> folder.
34
35</BODY>
36</HTML>