[−][src]Function rustpython_wasm::__wasm_bindgen_generated_pyEval
pub extern "C" fn __wasm_bindgen_generated_pyEval(
arg0: <str as RefFromWasmAbi>::Abi,
arg1: <Option<Object> as FromWasmAbi>::Abi
) -> <Result<JsValue, JsValue> as ReturnWasmAbi>::Abi
Evaluate Python code
var result = pyEval(code, options?);
code
: string
: The Python code to run in eval mode
options
:
vars?
:{ [key: string]: any }
: Variables passed to the VM that can be accessed in Python with the variablejs_vars
. Functions do work, and receive the Python kwargs as thethis
argument.stdout?
:"console" | ((out: string) => void) | null
: A function to replace the native print native print function, and it will beconsole.log
when givingundefined
or "console", and it will be a dumb function when giving null.