Build python extensions on-the-fly. Run C++ code directly from Python
Project description
Build python extensions on-the-fly.
Run C++ code directly from Python.
Links
Example
from cfly import build_module
mymodule = build_module('mymodule', '''
#define PY_SSIZE_T_CLEAN
#include <Python.h>
struct Foobar {
PyObject_HEAD
};
PyObject * meth_hello_world(PyObject * self) {
return PyLong_FromLong(1234);
}
''')
print(mymodule.Foobar)
print(mymodule.hello_world())
output
<class 'mymodule.Foobar'>
1234
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cfly-1.0.2.tar.gz
(9.9 kB
view hashes)