Download index.html from FakeURLs/PyOnline: direct link, hf CLI and curl.
- Browser
- Download file 1.24 kB
-
https://huggingface.co/spaces/FakeURLs/PyOnline/resolve/main/index.html
- Command line
-
hf download hf://spaces/FakeURLs/PyOnline/index.html
-
curl -L -o index.html https://huggingface.co/spaces/FakeURLs/PyOnline/resolve/main/index.html
1.24 kB
| <html> | |
| <head> | |
| <script src="https://cdn.jsdelivr.net/pyodide/v0.26.3/full/pyodide.js"></script> | |
| <title>PyOnline ®</title> | |
| </head> | |
| <body> | |
| <p> | |
| Type python code here. Powered by your browser | |
| </p> | |
| <input id="code" value="sum([1, 2, 3, 4, 5])" /> | |
| <button onclick="evaluatePython()">Run</button> | |
| <br /> | |
| <br /> | |
| <div>Output:</div> | |
| <textarea id="output" style="width: 100%;" rows="6" disabled></textarea> | |
| <script> | |
| const output = document.getElementById("output"); | |
| const code = document.getElementById("code"); | |
| function addToOutput(s) { | |
| output.value += ">>>" + code.value + "\n" + s + "\n"; | |
| } | |
| output.value = "Initializing PyOnline Runner...\n"; | |
| // init Pyodide | |
| async function main() { | |
| let pyodide = await loadPyodide(); | |
| output.value += "Ready!\n"; | |
| return pyodide; | |
| } | |
| let pyodideReadyPromise = main(); | |
| async function evaluatePython() { | |
| let pyodide = await pyodideReadyPromise; | |
| try { | |
| let output = pyodide.runPython(code.value); | |
| addToOutput(output); | |
| } catch (err) { | |
| addToOutput(err); | |
| } | |
| } | |
| </script> | |
| </body> | |
| </html> |