Created
December 30, 2023 14:50
-
-
Save doitian/9277b21ae34ce0136248a089bb5edd6f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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