* Runs a string of Python code from JavaScript, using :py:func:`~pyodide.code.eval_code` * to evaluate the code. If the last statement in the Python code is an * expression (and the code doesn't end with a semicolon), the value of the * expression is returned. * * @param code The Pyth
(
code: string,
options: { globals?: PyProxy; locals?: PyProxy; filename?: string } = {},
)
| 282 | * main(); |
| 283 | */ |
| 284 | static runPython( |
| 285 | code: string, |
| 286 | options: { globals?: PyProxy; locals?: PyProxy; filename?: string } = {}, |
| 287 | ): any { |
| 288 | if (!options.globals) { |
| 289 | options.globals = API.globals; |
| 290 | } |
| 291 | return API.pyodide_code.eval_code.callKwargs(code, options); |
| 292 | } |
| 293 | |
| 294 | /** |
| 295 | * Run a Python code string with top level await using |