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 ideal word files and build python from them, but I have no experience with C ++ or calling C ++ functions from python, and I don’t understand how to determine what these library functions will output. So there really are two questions:

  • 1) how to call C ++ functions from python and
  • 2) how to find out what the result of these functions will be, namely the result of the WPDocument :: parse function ( see http://www.abisource.com/~uwog/libwpd/ ) and how to use this in my python code. The function returns a WPDResult object , but I cannot understand what it is doing or how I will use it.
I looked briefly at SWIG, and that looks promising. Thoughts?
+3
source share
2 answers

The Boost.Python library makes it easy to interact between C ++ and Python.

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

+2

ctypes. Python. , ++, , .

+2

Source: https://habr.com/ru/post/1726689/


All Articles