Python short course: Python Debug in ipython using Magic Command

 In ipython, we can use the built-in magic run -d to debug. The full run command is  



%run [-n -i -e -G]
     [( -t [-N] | -d [-b] | -p [profile options] )]
     ( -m mod | filename ) [args]

For debugger, the commands are

run -d -b40 myscript  # line 40 as breakpoint in myscript.py
run -d -b myotherfile.py:20 myscript  # breakpoint is in the different files

Reference: ipython docs

Comments

Popular posts from this blog

Lab's weekly topic - week 50 2023 - Detailed explanation for encoder of U-Net

Lab's weekly topic - week 49, 2023 - What's limitations and possible solutions for a new AI tools to detect blood poisoning?

Lab's recommendation: Awesome books to learn machine learning and AI (continue updating)