73a4aeb4e0dd498b788870d732322e2594f71eb3
.redirects.gollum
... | ... | @@ -9,3 +9,4 @@ latex/beamer/図の挿入.md: latex/beamer/横に並べて図の挿入.md |
9 | 9 | wheel for onnx.md |
10 | 10 | __Header.md: _Header.md |
11 | 11 | network/yamaha/一つのグローバルIPアドレスに対して、ネットーワークを分離する.md: network/yamaha/一つのグローバルIPアドレスに対して、ネットワークを分離する.md |
12 | +python/exeptionのstack traceを表示する.md: python/exceptionのstack traceを表示する.md |
python/exception\343\201\256stack trace\343\202\222\350\241\250\347\244\272\343\201\231\343\202\213.md
... | ... | @@ -0,0 +1,13 @@ |
1 | +[python - How to catch and print the full exception traceback without halting/exiting the program? - Stack Overflow](https://stackoverflow.com/questions/3702675/how-to-catch-and-print-the-full-exception-traceback-without-halting-exiting-the) |
|
2 | + |
|
3 | +```python |
|
4 | +import traceback |
|
5 | +import sys |
|
6 | + |
|
7 | +try: |
|
8 | + do_stuff() |
|
9 | +except Exception: |
|
10 | + print(traceback.format_exc()) |
|
11 | + # or |
|
12 | + print(sys.exc_info()[2]) |
|
13 | +``` |
|
... | ... | \ No newline at end of file |
python/exeption\343\201\256stack trace\343\202\222\350\241\250\347\244\272\343\201\231\343\202\213.md
... | ... | @@ -1,13 +0,0 @@ |
1 | -[python - How to catch and print the full exception traceback without halting/exiting the program? - Stack Overflow](https://stackoverflow.com/questions/3702675/how-to-catch-and-print-the-full-exception-traceback-without-halting-exiting-the) |
|
2 | - |
|
3 | -```python |
|
4 | -import traceback |
|
5 | -import sys |
|
6 | - |
|
7 | -try: |
|
8 | - do_stuff() |
|
9 | -except Exception: |
|
10 | - print(traceback.format_exc()) |
|
11 | - # or |
|
12 | - print(sys.exc_info()[2]) |
|
13 | -``` |
|
... | ... | \ No newline at end of file |