mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-20 02:37:41 -05:00
21 lines
596 B
JavaScript
21 lines
596 B
JavaScript
import { clean, writeFile as writeFileUtil } from "./_utils.js";
|
|
|
|
// REQUIRES INTEGRATION TEST
|
|
/* c8 ignore start */
|
|
export const run = (interpreter, code) => interpreter.runPython(clean(code));
|
|
|
|
export const runAsync = (interpreter, code) =>
|
|
interpreter.runPythonAsync(clean(code));
|
|
|
|
export const setGlobal = (interpreter, name, value) => {
|
|
interpreter.globals.set(name, value);
|
|
};
|
|
|
|
export const deleteGlobal = (interpreter, name) => {
|
|
interpreter.globals.delete(name);
|
|
};
|
|
|
|
export const writeFile = ({ FS }, path, buffer) =>
|
|
writeFileUtil(FS, path, buffer);
|
|
/* c8 ignore stop */
|