add optional Rich highlighting to interactive Python sessions
This commit is contained in:
parent
1e0545152a
commit
41b2199225
1 changed files with 12 additions and 4 deletions
|
@ -16,7 +16,15 @@ try:
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# bpython gets broken by ANSI colors, so skip those
|
try:
|
||||||
if type(__builtins__) != dict:
|
import rich
|
||||||
sys.ps1 = '\001\x1b[1;32m\002>>> \001\x1b[0m\002'
|
|
||||||
sys.ps2 = '\001\x1b[0;32m\002... \001\x1b[0m\002'
|
import rich.traceback
|
||||||
|
rich.traceback.install()
|
||||||
|
|
||||||
|
import rich.pretty
|
||||||
|
rich.pretty.install()
|
||||||
|
|
||||||
|
from rich import inspect
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue