Skip to content

Instantly share code, notes, and snippets.

@zthompson47
zthompson47 / trio_repl-ptk2.py
Last active July 31, 2019 22:50
A simple REPL for Trio, with top-level `await` and built-in `nursery`
import ast
import sys
import traceback
from functools import partial
import trio
from pygments.styles import get_style_by_name
from pygments.lexers.python import PythonLexer
from prompt_toolkit.lexers import PygmentsLexer
from prompt_toolkit.patch_stdout import patch_stdout