embedding Python: how to avoid memory leaks?

Torsten Bronger bronger at physik.rwth-aachen.de
Thu Mar 9 06:28:22 EST 2006


Hallöchen!

Andrew Trevorrow <andrew at trevorrow.com> writes:

> [...]
>
> [...]  Not just once, but many times in a single session, and
> without leaking memory.  Preferably an open source app so I can
> see how it's done.
>
> Our app (http://golly.sourceforge.net/) currently uses calls
> like these every time a user decides to run a script:
>
>    Py_Initialize();
>    PyRun_SimpleString("execfile('foo.py')");

Does PyRun_AnyFile show the same effect?  That's the way I'm about
to go.

Tschö,
Torsten.

-- 
Torsten Bronger, aquisgrana, europa vetus            ICQ 264-296-646



More information about the Python-list mailing list