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.12.tar.gz
(9.5 kB
view hashes)
Built Distribution
Close
Hashes for cfly-0.9.12-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfa1035364252492c7d9e40513d753f5bf8e69958df39688ba7e87c597ecb2c5 |
|
MD5 | 4af361fe960fe80109af70179121d2d5 |
|
BLAKE2b-256 | 6aaf9693940606964173a798e726a6794c5dd0608d77a6215225e9fba971b73e |