Created
May 11, 2025 03:18
-
-
Save IvanIsCoding/8bb97d428169e073af4afa598e1d2932 to your computer and use it in GitHub Desktop.
Pyodide + Rustworkx Demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<script src="https://cdn.jsdelivr.net/pyodide/v0.27.5/full/pyodide.js"></script> | |
</head> | |
<body> | |
Pyodide test page <br> | |
Open your browser console to see Pyodide output | |
<script type="text/javascript"> | |
async function main() { | |
let pyodide = await loadPyodide(); | |
await pyodide.loadPackage( | |
"http://localhost:8000/rustworkx-0.17.0-cp39-abi3-pyodide_2025_0_wasm32.whl", | |
); | |
const output = document.getElementById("output"); | |
const result = await pyodide.runPythonAsync(` | |
import rustworkx as rx | |
graph = rx.generators.cycle_graph(10) | |
paths = rx.floyd_warshall(graph) | |
print(paths) | |
`); | |
} | |
main(); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment