Using python for dynamic behavior from C++

A.T.Hofkamp hat at se-162.se.wtb.tue.nl
Wed Aug 15 10:11:09 EDT 2007


On 2007-08-15, Jorgen Bodde <jorgen.maillist at gmail.com> wrote:
> Hi all,
>
> I am looking into using Python to introduce dynamic behavior in my
> C++, e.g. something like a simulation where objects can interact with
> eachother. I know Python can be called from C++, but is it possible to
> call a binary compiled Python file / array from C++ ? The reason I ask
> is that if my objects call a script every tick to do something, I
> would not like to let the python interpreter recompile the same code
> over and over again.
>
> Any pointers to how I can do that?

It is called 'embedding the Python Interpreter' and is in the second part of
the 'Extending and Embedding the Python Interpreter' document at python dot org.

Albert



More information about the Python-list mailing list