How to get pretty python interpreter automagically?

How to get pretty python interpreter automagically?

Install rich

➜ pip install rich
➜ mkdir ~/pystartup
➜ touch ~/pystartup/startup.py

Create startup script

➜  ~ echo "import rich.pretty; rich.pretty.install()" > ~/pystartup/startup.py

export to .bashrc or .zshrc

echo "export PYTHONSTARTUP=~/pystartup/startup.py" >> ~/.zshrc

rich_python.png