compat.pocketpy
#includePocketPy 2.2.0, a small embeddable Python 3.x interpreter in C11 (MIT)
#include <pocketpy.h>
mcpp add compat.pocketpy@2.2.0
用法
來自本倉庫自己的測試專案 —— CI 真的編譯並執行過,不是為了網站寫的。
// compat.pocketpy — PocketPy 2.2.0: Python evaluated by the interpreter,
// checked by value through the C API.
//
// WHAT THIS ASSERTS AND WHY
//
// the version PK_VERSION and the interpreter's own sys.version
// exec and eval statements and expressions in the main module, the
// results read back as int, float, str and bool
// containers a dict and a list built in Python, walked from C++
// native functions a C function bound into the main module and called
// from Python, with its argument checks raising TypeError
// errors a syntax error, a runtime error, an uncaught raise and
// runaway recursion: each returns false with a formatted
// message, and the VM goes on once it is cleared
// the watchdog PK_ENABLE_WATCHDOG=1: py_watchdog_begin ends an endless
// loop with a TimeoutError
// the configuration pkpy.configmacros: the PK_ENABLE_* the package sets
// upstream's fix exceptions kept alive across garbage collections
// (de8351ed, applied by install()): without it the
// collector reads their unset traceback values and
// crashes
// the library json and math (dmath), modules compiled in C, and the
// …
tests/examples/pocketpy/tests/pocketpy.cpp · 專案 tests/examples/pocketpy
建置
- targets
pocketpy (lib)- language
c++23- C standard
gnu11- import std
- no
- include dirs
*/include
原始檔 (1)
*/mcpp/pocketpy_unity.c
產生的檔案
pocketpy-2.2.0/mcpp/pocketpy_unity.c