https://github.com/nagariahussain/pypractise
Practice Python Questions, in the browser!
https://github.com/nagariahussain/pypractise
Last synced: 7 months ago
JSON representation
Practice Python Questions, in the browser!
- Host: GitHub
- URL: https://github.com/nagariahussain/pypractise
- Owner: NagariaHussain
- Created: 2021-05-15T08:28:35.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-16T08:13:09.000Z (over 4 years ago)
- Last Synced: 2025-01-12T07:36:27.880Z (9 months ago)
- Language: HTML
- Size: 139 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# A Python Programming Questions Website
NO servers.
NO databases.Just a Static Site!
Uses `pyodide` to evaluate python code in the browser.
## Some notes on `pyodide`
### Capturing `stdout`:
```py
pyodide.runPython(`
import sys
import iosys.stdout = io.StringIO();
`);
```Now, run any code that sends something to `stdout`:
```py
pyodide.runPython(
print("Hello, World!")
);
```Getting the output:
```js
let output = pyodide.runPython(`sys.stdout.getvalue()`);
console.log(output); // "Hello, World!\n"
```