Nowadays I pretty much only using the Python Rich implementation for printing. i.e from rich import print.
Rather than adding this to every script I write, is there a way to replace the built-in Python print with the Rich implementation?
You can create a script usercustomize.py inside the user site-packages directory which performs the import and assigns it to the builtins:
import builtins
import rich
builtins.print = rich.print
Also check the documentation of the site module for more information (the same can be achieved for all users via sitecustomize.py).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With