- 在源代码中设置断点
- python 3.7 版本开始
breakpoint()
- python 3.7 版本以前
import pdb; pdb.set_trace()
import ipdb; ipdb.set_trace()
- python 3.7 版本开始
- 通过设置环境变量将
ipdb
设置为默认 debuggerexport PYTHONBREAKPOINT=ipdb.set_trace
- IPython interactive mode alias in .pdbrc
import IPython from traitlets.config import get_config cfg = get_config() # enable syntax highlighting cfg.InteractiveShellEmbed.colors = 'Linux' cfg.InteractiveShellEmbed.confirm_exit = False alias interacti IPython.embed(config=cfg)
Created
December 27, 2021 11:27
-
-
Save Kunkgg/3ff7cf1c03817c553ade68eb9252d345 to your computer and use it in GitHub Desktop.
python debug
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment