Build python extensions on-the-fly. Run C++ code directly from Python
Project description
# cfly
- Build python extensions on-the-fly.
- Run C++ code directly from Python.
## Example
```py
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**
```py
<class 'mymodule.Foobar'>
1234
```
- Build python extensions on-the-fly.
- Run C++ code directly from Python.
## Example
```py
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**
```py
<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.10.tar.gz
(6.5 kB
view hashes)
Built Distribution
Close
Hashes for cfly-0.9.10-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa9eb6cc532012c363089b95dc897931c9a1576db758c131f1925e5caeb98340 |
|
MD5 | 23f060d9038823e11e566bd77fc468bc |
|
BLAKE2b-256 | 1f9a521db7133fbf52e0204c5c695792185d9c4dd2f48e3cee7b765e997f0c6b |