I want to write code in Python but still have real-time capable code. This means I cannot use the Python interpreter. Mypyc looks promising for this very specific purpose, even though it is not a goal of the tool, as it is only meant to accelerate Python. Would it be possible to run mypyc generated code without the Python interpreter?
I have tried the following things, without success:
- Compiling
__native.c
with gcc and manually linking it to files it requires, such asPython.h
(in python installation) and mypyc libraries. - Opening the .so file in a C program with
dlopen
and importing functions withdlsym
.