Skip to main content

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.

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


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.3.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

cfly-1.0.3-py2.py3-none-any.whl (7.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file cfly-1.0.3.tar.gz.

File metadata

  • Download URL: cfly-1.0.3.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cfly-1.0.3.tar.gz
Algorithm Hash digest
SHA256 c84696286ce80326596876600aec36c8ad96673e0752e11b32e927f05d94a815
MD5 c77f0ecbf87a818878239f35ed3ad3e1
BLAKE2b-256 106072118609267111d3fcb4d8c83eb1219cd2842f5c6ca10163abec2cbaa869

See more details on using hashes here.

File details

Details for the file cfly-1.0.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for cfly-1.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 615d3a509ca8453fdb6654aba9ee3f861d7459becd0a9a55250101636f179c6a
MD5 09b516509c74773cebaf0d25b5775dcb
BLAKE2b-256 f12d04b804f50a8479f64a7e0aa76907ddd05bb9f50fedf3fd4586adb4b7a64f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page