@programmingplus/pyjs
v0.0.7
Published
Python (CPython) in the browser.
Downloads
8
Readme
PyJS
Python (CPython) in the browser.
Getting Started
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
Purpose
To port CPython to the browser for education so that people can
- run simple Python code directly in the browser
- type things to standard input interactively
- retrieve data from standard output and standard error