Import C++ files directly from Python
github.com
github.com
>>> import pyximport; pyximport.install()
>>> import helloworld
Hello World
The example is taken from Cython's basic tutorial page[0], in which helloworld.pyx simply has a print "Hello World" statement.However I don't don't Cython and cppimport are interchangeable, or that using one excludes using the other. cppimport is for bringing C++ code in a seamless way, while Cython makes it easy to optimize Python code converting it to C (which you can further hand optimize if you so need it).
[0] http://docs.cython.org/src/tutorial/cython_tutorial.html