Using C to execute Python

Oleg Broytmann phd at
Wed Jun 23 12:47:28 CEST 1999


On Wed, 23 Jun 1999, Thomas RЬberg wrote:
> I have a C program and I want to call certain Python methods / functions
> passing quite a few parameters.
> How can I do this, in general fashion?

   You need to embed python interpreter into your program. That is: you
link your program with libpython.a and call some functions (initilize, evel
string, etc.)
   More details in the standard docs on Extending and Embedding Python.

> I would have to include python.h, I reckon - where can I find this, I've
> been searching all over for it (is it just me???)

   It is in the source distribution.

> I'm no expert, far from, in Python...
> Thomas
> email: thomar at

    Oleg Broytmann        Netskate/Inter.Net.Ru        phd at
           Programmers don't die, they just GOSUB without RETURN.

More information about the Python-list mailing list