Steps are:
1. Install ipython
2. Add the import in your codes:
" from IPython.core.debugger import Tracer; debug_here = Tracer() " or "from IPython.debugger import Tracer; debug_here = Tracer() " depends your python version
3. Add several lines of "debug_here" and "print profits value" in the proper positions
4. In ipython:
run codesname.py
1. Install ipython
2. Add the import in your codes:
" from IPython.core.debugger import Tracer; debug_here = Tracer() " or "from IPython.debugger import Tracer; debug_here = Tracer() " depends your python version
3. Add several lines of "debug_here" and "print profits value" in the proper positions
4. In ipython:
run codesname.py
type "c" to continue or type "n" to go to next line
如: 点n回车,然后可以一路回车,让他一行一行的运行。
本文介绍了如何在Python环境中利用ipython进行代码调试,包括安装ipython、导入调试工具、添加调试断点和打印变量值的方法,以及在ipython中运行代码并手动控制执行流程的步骤。
877

被折叠的 条评论
为什么被折叠?



