Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                

[][src]Function rustpython_wasm::eval_py

pub fn eval_py(
    source: &str,
    options: Option<Object>
) -> Result<JsValue, JsValue>

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 variable js_vars. Functions do work, and receive the Python kwargs as the this argument.
  • stdout?: "console" | ((out: string) => void) | null: A function to replace the native print native print function, and it will be console.log when giving undefined or "console", and it will be a dumb function when giving null.