Skip to content

Commit

Permalink
Merge pull request #13 from Amarjeetkumart/master
Browse files Browse the repository at this point in the history
Removing the previous execution state for pythonExecute function
  • Loading branch information
SandeepVashishtha authored Oct 7, 2024
2 parents 7923c5b + 086c157 commit 89e521c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/CodeEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ hello_world()`);
}

try {
// removing the previous execution state for pythonExecute function
pyodideRef.current.runPython(`globals().clear()`);

await pyodideRef.current.loadPackagesFromImports(code);
let output = '';
pyodideRef.current.globals.set('print', (s) => {
Expand Down

0 comments on commit 89e521c

Please sign in to comment.