2

I am using Pyodide to compile python code in the browser. The code below is used to execute the python code in editor and display the result in console. For the errors, I am displaying it using alert() as shown below, and it works just fine. Now, I want to change the behaviour of pyodide to display the result in another webpage. for example: var resultWindow = window.open("resultPage.html"); resultWindow.document.write(output);.

function compilerResult() {
    try {
        pyodide.runPython(editor.doc.getValue())
    } catch(err) {
        alert(err)
    }
}
  • 1
    You could serialize your result (e.g. as string), and include it in the request to your other page. Or use sessionStorage or localStorage https://stackoverflow.com/a/46785096/1791279 – rth May 14 '21 at 15:10

0 Answers0