Traceback color
-
Is there a way to control the traceback color in the console? My poor eyes can't really read the red on black.
-
@mikael See here
For the interactive console.
Anyway, you can also change the theme in the Pythonista settings to have a non-black background.
-
My
pythonista_startup
repo has a customize_sys_hooks.py that implements a better traceback display in the console. Among other things, it lets you customize the colors that are used. (It also has a few other features, for example the file paths in tracebacks can be tapped to open the source file in question.) The default colors are designed for light themes, but you can change theset_color
calls to use colors that work better with a dark theme.This only affects tracebacks though, any other stderr output will still be displayed in red. You could probably customize that too, by writing a
sys.stderr
replacement that sets the console color to something different. Alternatively, if you don't care about the difference between stdout and stderr, you can dosys.stderr = sys.stdout
.