Call C++ Function in Python

Dave Kuhlman dkuhlman at
Mon Aug 12 19:00:11 CEST 2002

Also look at SWIG (

For some purposes, especially where you have a header file 
describing the functions you want to call, SWIG can often generate 
the wrappers for you automatically.

  - Dave

Martin v. Loewis wrote:

> arivu at (Arivazhagan) writes:
>> We are planning to use python in our c++ Project. We have to
>> invoke a C++ function from Python. can any one help?
> I recommend you read the "extending and embedding" tutorial:
> You'll have to write an extension module. Since you will need to
> compile that with the C++ compiler, please make sure to use extern
> "C" on the module init function.
> Regards,
> Martin

Dave Kuhlman
dkuhlman at

More information about the Python-list mailing list