https://github.com/desktop-cgi/wasm-python
wasm-python wasm files to run python scripts in nodejs environments
https://github.com/desktop-cgi/wasm-python
Last synced: 5 months ago
JSON representation
wasm-python wasm files to run python scripts in nodejs environments
- Host: GitHub
- URL: https://github.com/desktop-cgi/wasm-python
- Owner: desktop-cgi
- License: mit
- Created: 2023-07-04T09:45:31.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-25T12:34:45.000Z (over 2 years ago)
- Last Synced: 2025-07-15T13:24:11.871Z (11 months ago)
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wasm-python
wasm-python wasm files to run python scripts in nodejs environments
USAGE:
```
// hello_python.js
const { loadPyodide } = require("pyodide");
const path = require("path");
async function hello_python() {
let pyodide = await loadPyodide({
// indexURL: "",
indexURL: path.join("./node_modules/pyodide"),
});
// RUN YOUR PYTHON CODE
return pyodide.runPythonAsync("1+1");
}
hello_python().then((result) => {
console.log("Python says that 1+1 =", result);
});
```
Demos can be found here in the [demos](https://github.com/desktop-cgi/wasm-python/tree/main/demos) folder
This is a direct port of [npm package to run python using pyodide](https://www.npmjs.com/package/pyodide) ported for [desktop-cgi](https://github.com/desktop-cgi)
Check out more on different ways of using Python language interpretor inside of JS, Node.js here [https://pythondev.readthedocs.io/wasm.html](https://pythondev.readthedocs.io/wasm.html)
[PYODIDE](https://pyodide.org/en/stable/)