An open API service indexing awesome lists of open source software.

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!

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 io

sys.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"
```