MCPcopy Index your code
hub / github.com/pyodide/pyodide / runPython

Method runPython

src/js/api.ts:284–292  ·  view source on GitHub ↗

* 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 } = {},
  )

Source from the content-addressed store, hash-verified

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

Callers 10

d8-test.mjsFile · 0.80
factoryFunction · 0.80
factoryFunction · 0.80
patchPlatformForUvFunction · 0.80
calculateSysPathFunction · 0.80
mainFunction · 0.80
handleExitFunction · 0.80
mainFunction · 0.80

Calls 1

callKwargsMethod · 0.80

Tested by 3

factoryFunction · 0.64
factoryFunction · 0.64