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-0.9.11.tar.gz
(9.5 kB
view hashes)
Built Distribution
Close
Hashes for cfly-0.9.11-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d49426a562d4eb4bb794da58bcfa7ad141546da0892b5558ea11c7db564e0eca |
|
MD5 | 52d5c74af64add60297e1d96e14047af |
|
BLAKE2b-256 | 182d741ecda960049e9ddb2b0f44fe55049f5700ac8b12cce16836c329a5691f |