Commit 18a04087 authored by Boxiang Sun's avatar Boxiang Sun

Display the text result of Python code

parent 2da51db3
......@@ -325,9 +325,24 @@
});
}
function renderCodeblock(result_text) {
var div = document.createElement('div'),
pre = document.createElement('pre'),
result = document.createElement('code');
div.classList.add('code-block');
if (result_text !== undefined) {
result.innerHTML = result_text;
pre.appendChild(result);
div.appendChild(pre);
document.body.appendChild(div);
}
}
function executePyCell(line_list) {
var result, code_text = line_list.join('\n');
result = pyodide_instance.runPython(code_text);
renderCodeblock(result);
}
function executeCodeCell(line_list, option) {
......
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