From 41840ac1c9943feb7e356b96946ac1ef4be12c07 Mon Sep 17 00:00:00 2001 From: Niklas Molnes Hole Date: Wed, 13 Oct 2021 01:05:13 +0200 Subject: [PATCH] WIP original Brython implementation (with DOM access) --- README.md | 4 +- docs/index.html | 34 +++++++++- index.js | 171 ++++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 201 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 31995d7..71452a3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Client-side Python runner -Supported python runners so far: [Pyodide][pyodide], [Skulpt][skulpt], [Brython][brython] +Supported python runners so far: [Pyodide][pyodide], [Skulpt][skulpt], [Brython][brython], [brythonWebWorker (BrythonRunner)][brython-runner] Try it out [here](https://niklasmh.github.io/client-side-python-runner/). @@ -368,6 +368,8 @@ _DISCLAIMER: The numbers in the table are not scientifically calculated, thus th [skulpt-t]: https://skulpt.org/ [brython]: https://brython.info/ [brython-t]: https://brython.info/tests/editor.html +[brython-runner]: https://github.com/pythonpad/brython-runner +[brython-runner-t]: https://pythonpad.github.io/brython-runner/ [rustpython]: https://brython.info/ [rustpython-t]: https://rustpython.github.io/demo/ [pypyjs]: https://github.com/pypyjs/pypyjs diff --git a/docs/index.html b/docs/index.html index baf7959..9e95908 100644 --- a/docs/index.html +++ b/docs/index.html @@ -96,7 +96,7 @@ title: 'Loading example', jsCode: `// This is not necessary unless you want to // load the engines separately from the execution -await loadEngines(['skulpt', 'pyodide', 'brython']) +await loadEngines(['skulpt', 'pyodide', 'brython', 'brythonWebWorker']) // Use setOptions to set loading hooks (do this before the line above) setOptions({ @@ -107,7 +107,12 @@ engines: ['none'], showDebug: true, run: async (input) => { - await loadEngines(['skulpt', 'pyodide', 'brython']); + await loadEngines([ + 'skulpt', + 'pyodide', + 'brython', + 'brythonWebWorker', + ]); }, }, { @@ -488,6 +493,27 @@

}); }} /> +