Python+PIL in ActiveX control

Eric van Riet Paap eric at quadgames.com
Fri Nov 16 06:43:41 EST 2001


Hi all,

I was trying to embed the Python interpreter in a windows ActiveX control.
The control I was working on can read and display tga files.
To make it more powerful I wanted to embed the Python Image Library (and
Python)
in the control.

However: I ran into very odd problem!

I've made an activex method the would execute some python code, in the line
off:
      Py_Initialize();
      PyRun_SimpleString("a=3\n");
The problem is that Py_Initialize(); seem to working, but when the next line
is executed the control
rapidely consumes all available memory and starts swapping to disk.



The control can be found in: http://quadgames.com/dev/
You must first register the control with the register.bat script.
After that the two test examples (source included) can be run, they have
identical functionality,
but one is written with Macromedia Director 8.5 (Shockwave) and the other
with VisualBasic6.0.

When you press the Python button in these programs while the task manager is
open you see what I mean!

You can kill the program when yoedon't wait too long, but be careful that
you don't have important programs open!!!


enjoy,

    Eric van Riet Paap, QuadGames.com
    Oudegracht a/d Werf 309
    3511 PC  Utrecht, The Netherlands






More information about the Python-list mailing list