".github/git@developer.sourcefind.cn:wangsen/mineru.git" did not exist on "899c79189cd3af91337ca750639e61206bffc121"
Commit 4efb8638 authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

refac

parent 8f8ce269
......@@ -138,18 +138,14 @@
};
const executePython = async (code) => {
result = null;
stdout = null;
stderr = null;
executed = true;
let pyodide = await loadPyodide({
indexURL: '/pyodide/',
stderr: (text) => {
console.log('An error occured:', text);
if (stderr) {
stderr += `${text}\n`;
} else {
stderr = `${text}\n`;
}
},
stdout: (text) => {
console.log('Python output:', text);
......@@ -158,14 +154,22 @@
} else {
stdout = `${text}\n`;
}
},
stderr: (text) => {
console.log('An error occured:', text);
if (stderr) {
stderr += `${text}\n`;
} else {
stderr = `${text}\n`;
}
}
});
result = pyodide.runPython(code);
console.log(result);
console.log(stderr);
console.log(stdout);
console.log(stderr);
};
$: highlightedCode = code ? hljs.highlightAuto(code, hljs.getLanguage(lang)?.aliases).value : '';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment