|
|
2 лет назад | |
|---|---|---|
| .. | ||
| README.md | 2 лет назад | |
| compile.sh | 2 лет назад | |
| func.c | 2 лет назад | |
| main.py | 2 лет назад | |
This sample demonstrates how to declare a Python function as NativeSymbol.
Steps of the example:
c_func from WASM.c_func calls python_func from Python.python_func calls add from WASM.Follow instructions build wamr Python package.
Compile WASM app example,
./compile.sh
python main.py
Output:
python: calling c_func(10)
c: in c_func with input: 10
c: calling python_func(11)
python: in python_func with input: 11
python: calling add(11, 1000)
python: result from add: 1011
c: result from python_func: 1012
c: returning 1013
python: result from c_func: 1013
deleting ExecEnv
deleting Instance
deleting Module
deleting Engine