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:
|
||||
pass
|
||||
|
||||
# bpython gets broken by ANSI colors, so skip those
|
||||
if type(__builtins__) != dict:
|
||||
sys.ps1 = '\001\x1b[1;32m\002>>> \001\x1b[0m\002'
|
||||
sys.ps2 = '\001\x1b[0;32m\002... \001\x1b[0m\002'
|
||||
try:
|
||||
import rich
|
||||
|
||||
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