Skip to content

Instantly share code, notes, and snippets.

@doitian
Created December 30, 2023 14:50
Show Gist options
  • Save doitian/9277b21ae34ce0136248a089bb5edd6f to your computer and use it in GitHub Desktop.
Save doitian/9277b21ae34ce0136248a089bb5edd6f to your computer and use it in GitHub Desktop.
#!/bin/bash
# Start Python REPL and setup rich
# https://rich.readthedocs.io/en/latest/introduction.html#rich-in-the-repl
""":"
PYTHON=${PYTHON:-python}
if command -v python3 &>/dev/null; then
PYTHON=python3
fi
exec "$PYTHON" -i "$0"
: "
"""
try:
from rich import pretty
from rich import inspect
pretty.install()
except ModuleNotFoundError:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment