twneale
twneale

Reputation: 2946

How to use C++ lib from python

I would like to know how to use python to make calls to a C++ library called libwpd to read word perfect files and build python objects from them, but I have no experience with C++ or calling C++ functions from python, and I don't understand how to figure out what the output of these library functions would be. So that's really two questions:

I looked into SWIG briefly, and it looks promising. Thoughts?

Upvotes: 3

Views: 378

Answers (2)

Roberto Bonvallet
Roberto Bonvallet

Reputation: 33319

The Boost.Python library allows easy interoperability between C++ and Python.

The tutorial shows how to wrap C++ functions and classes to use them from Python.

Upvotes: 2

Peter Rowell
Peter Rowell

Reputation: 17713

Checkout ctypes. It's part of the standard Python library set. I can't speak to it's use with C++, but I suspect it will work nicely.

Upvotes: 2

Related Questions