Using C to execute Python

Oleg Broytmann phd at emerald.netskate.ru
Wed Jun 23 06:47:28 EDT 1999


Hi!

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 ifi.ntnu.no

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





More information about the Python-list mailing list