From: Jack Jansen Date: Tue, 9 Oct 2001 23:14:06 +0000 (+0000) Subject: Updated, and added a very terse description of PyMac_SetConsoleHandler(). X-Git-Tag: v2.2.1c1~1360 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e67dab3d3f9ffafb5668aab509abbd6c84f5ff35;p=python Updated, and added a very terse description of PyMac_SetConsoleHandler(). --- diff --git a/Mac/Demo/embed.html b/Mac/Demo/embed.html index e5ac7a0eb9..e0ca756498 100644 --- a/Mac/Demo/embed.html +++ b/Mac/Demo/embed.html @@ -6,9 +6,8 @@

Embedding Python on the Mac


Note: if you have a binary-only release of MacPython you will not -have this demo installed. Install the developer option (in the standard installer) or go to -Jack's MacPython Page -to download either a source release if you want to embed +have this demo installed. Install the developer option (in the standard installer) or +a source release if you want to embed Python in other applications.

Embedding Python on the mac is pretty similar to embedding it on other @@ -23,8 +22,8 @@ resource files and calls Py_Initialize.

  • You have to be consequent in your use of GUSI. If the library uses it so should your program and vice versa. -
  • The console-behaviour (close-on-exit, etc) is controlled by Python, -but you are of course free to change that after calling PyMac_Initialize(). +
  • The console-behaviour (close-on-exit, etc) is controlled by Python +but you can overwrite this with PyMac_SetConsoleHandler(). The Python environment is started with a dummy argc and argv, and initial @@ -37,10 +36,9 @@ The most logical way to embed Python is to link it against the shared library PythonCore. An example project and source can be found in the embed folder.

    -Note: you may think that you do not have the project file -PythonCore but actually you do: the standard installation -process deposits it in the Extensions folder in the system -folder under the name PythonCore version. Add that file -to the project replacing PythonCore.

    +This example code also shows how to override the console: if you pass the +-q argument in the argument box output is thrown away. If you +pass the -d option the output is sent to DebugStr +(so be sure to use this only when running the example under a debugger).