Python (CPython) in the browser.
Python (CPython) in the browser.
You can import the latest PyJS from CDN directly:
<pre id="output"></pre>
<script type="module">
import { run } from "https://cdn.jsdelivr.net/npm/@programmingplus/pyjs";
const output = (s) => (document.getElementById("output").textContent += s);
run(`print(42 ** 42)`, { writeStdout: output, writeStderr: output });
</script>
Or, you may install PyJS with npm:
$ npm install --save @programmingplus/pyjs
To port CPython to the browser for education so that people can