Created
August 9, 2023 15:36
-
-
Save HubertReX/f7d6edc35f5bdc58a58c7859c8c0e1c6 to your computer and use it in GitHub Desktop.
python profile script to prettify printing and traceback using Rich lib
This file contains 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
# https://textual.textualize.io/blog/2023/07/27/using-rich-inspect-to-interrogate-python-objects/ | |
# pip install rich | |
# set PYTHONSTARTUP=c:\Users\user\.pythonrc | |
from functools import partial | |
from rich import inspect, pretty, print | |
from rich import traceback | |
help = partial(inspect, help=True) | |
pretty.install() | |
print("Hello [yellow]Hubert[/]") | |
traceback.install( | |
show_locals=False, width=150, locals_max_string=50 | |
#, suppress=[datetime, path, glob] | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment