better-exceptions インストール 使い方 better-exceptions github.com better-exceptionsを使用すると例外情報が図のようにみやすくなる。 インストール pipでインストールできるので下記コマンドを実行。 $ pip install better_exceptions 使い方 以下のようにbetter_exceptionsをインポートすればよい。 import better_exceptions 試しに下記コードを実行した場合の出力を比べてみる。 import better_exceptions foo = 52 def shallow(a, b): deep(a + b) def deep(val): global foo assert val > 10 and foo == 60 bar = foo - 50 shallow(b
![Pythonメモ : better-exceptionsで例外情報を見やすくする - もた日記](https://cdn-ak-scissors.b.st-hatena.com/image/square/2b019df1662f93047d6e3e4e045ee350b26f9f71/height=288;version=1;width=512/https%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Fw%2Fwonder-wall%2F20170724%2F20170724160321.png)