python:debug
차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
다음 판 | 이전 판 | ||
python:debug [2020/06/13 09:51] – 만듦 rex8312 | python:debug [2025/02/20 02:15] (현재) – rex8312 | ||
---|---|---|---|
줄 1: | 줄 1: | ||
====== Python: Debug ====== | ====== Python: Debug ====== | ||
- | | + | | Examine exception from interpreter |jupyter notebook ' |
- | * https:// | + | | Pinpoint variables in scope |import IPython; IPython.embed() |
- | * https:// | + | | Pinpoint variables in scope |import code; code.interact(local=locals()) |
+ | | ::: |whos | | ||
+ | | Set breakpoint | ||
+ | | Run with debugger | ||
+ | | Start debugger on CTRL-C | ||
+ | | ::: |pudbpudb.set_interrupt_handler() | | ||
+ | | Trace threads | ||
+ | | Record logs |logging.getLogger(__name__) | ||
+ | | Debug tests |pip install pdbpp; py.test --pdb | | ||
+ | |||
+ | | ||
+ | |||
+ | |||
+ | <code python> | ||
+ | import sys | ||
+ | from ptpdb import set_trace | ||
+ | sys.breakpointhook = set_trace | ||
+ | </ | ||
+ | |||
+ | <code python> | ||
+ | # https:// | ||
+ | os.environ[' | ||
+ | breakpoint() | ||
+ | |||
+ | set PYTHONBREAKPOINT=" | ||
+ | </ | ||
+ | |||
+ | * https:// | ||
+ | * https:// | ||
+ | * https:// | ||
+ | * https:// | ||
+ | |||
+ | ===== 원격 embed ===== | ||
+ | |||
+ | * https:// | ||
+ | * https:// | ||
+ | |||
+ | ===== print 문 대안 ===== | ||
+ | |||
+ | * https:// | ||
+ | * https:// | ||
+ | |||
+ | |||
+ | ===== CPU/Memory 사용량 측정/ | ||
+ | |||
+ | | ||
+ | * https:// | ||
+ |
python/debug.1592041903.txt.gz · 마지막으로 수정됨: (바깥 편집)