3 ms·
I always liked how this automatically hooks into the python installation via pip, but preferred another text format. Hm. So if you want to permanently replace p
by cknd 7y ago
I always liked how this automatically hooks into the python installation via pip, but preferred another text format. Hm. So if you want to permanently replace python's crash message, you could put a file `sitecustomize.py` into your python path, with these contents for example:
# in site-packages/sitecustomize.py:
print('hello!')
import sys; sys.excepthook = lambda a,b,c: print('<bomb emoji>')
# or also:
import stackprinter
stackprinter.set_excepthook(style='darkbg')
(you can find the path by `python -c "import site; print(site.PREFIXES)" `)
It felt bit much to do that automatically on installation, but maybe it would be a good option to have
- tastroder 7y agoIn case you're looking for opinions there: I pretty much like libraries like this for development but prefer manual activation, e.g. only when my system is running with a debug flag, over libraries messing with the environment itself. Thanks for making it available, the output looks neat, looking forward to try it out.