./wip/py-cppimport, Import C++ files directly from Python

[ CVSweb ] [ Homepage ] [ RSS ] [ Required by ] [ Add to tracker ]

Branch: CURRENT, Version:, Package name: py38-cppimport-, Maintainer: kamelderouiche

TODO: Adjust the following lines from README.md

##### If you've used cppimport version 0.0.\*, some new features for you! Compiler arguments, multiple source files, bug fixes! Read on.

# Import C or C++ files directly from Python!
Let's try it out. First, if you're on Linux or OS X, install with the terminal command `pip install cppimport`.

Most cppimport users combine it with [pybind11](https://github.com/pybind/pybind11), but you can use a range of methods to create your Python extensions. Raw C extensions, Boost.Python, SWIG all work. Let's look at a simple C++ extension:

#include <pybind11/pybind11.h>

namespace py = pybind11;

int square(int x) {
return x * x;

PYBIND11_MODULE(somecode, m) {
m.def("square", &square);

Master sites:

SHA1: dc89da03dde3a9ee47dd6df50d9be67ba1a35ad7
RMD160: ac51cd3e672681d1700105019e75fa51341aa473
Filesize: 4173.2 KB

Version history: (Expand)