This commit is contained in:
blueloveTH 2024-08-12 13:37:09 +08:00
parent e2d4f57859
commit b01234d27e

View File

@ -259,14 +259,15 @@ DEALINGS IN THE SOFTWARE.
var Module = {
onRuntimeInitialized: function () {
Module.ccall('py_initialize', null, [], []);
console.log("py_initialize() called");
},
print: function (text) {
console.log(text);
code_output.innerText += text + '\n';
},
onabort: function (what) {
code_output.innerText += 'Aborted: ' + what + '\n';
Module.ccall('py_finalize', null, [], []);
console.log("py_finalize() called");
}
};
</script>
@ -294,6 +295,7 @@ DEALINGS IN THE SOFTWARE.
'py_exec', 'boolean', ['string', 'string', 'number', 'number'],
[source, 'main.py', 0, 0]
);
console.log("py_exec() called");
if (!ok) {
Module.ccall('py_printexc', null, [], []);
Module.ccall('py_clearexc', null, ['number'], [0]);