Skip to content

Usage

PyConsole supports novel functionalities that a normal REPL usually doesn't

  1. Top level async await
python
async def add(x, y):
  return x + y
await add(1, 2)
# 3
  1. Fetch data from url:
python
from js import fetch
todo = await fetch('https://jsonplaceholder.typicode.com/todos/1')
(await todo.json()).to_py()
json
{'userId': 1, 'id': 1, 'title': 'delectus aut autem', 'completed': False}