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.13.tar.gz
(9.6 kB
view hashes)
Built Distribution
Close
Hashes for cfly-0.9.13-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfd646afa5d68f72f200239688bbd038dfd8fbe931ede1bf442b9c89613266a0 |
|
MD5 | 84dd06100efb28d60e1948581d5fc080 |
|
BLAKE2b-256 | a7cace7ad5f465ee4b903c17548ff0691fd445e8837178f4c867c6cb3a1a976c |