Created
April 18, 2018 15:01
-
-
Save felipecustodio/06d6ee8e2e89e9dca7597f99ab758990 to your computer and use it in GitHub Desktop.
Colorized output for errors when executing python script on terminal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if __name__ == '__main__': | |
| try: | |
| import IPython.core.ultratb | |
| except ImportError: | |
| # No IPython. Use default exception printing. | |
| pass | |
| else: | |
| import sys | |
| sys.excepthook = IPython.core.ultratb.ColorTB() | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment