当前位置:网站首页>Common commands for IPDB debugging
Common commands for IPDB debugging
2022-07-16 07:16:00 【Struggling youth, come on】
Use ipdb debugging Python Code
1. Introduce :IPDB What is it? ?IPDB(Ipython Debugger) It's an integrated Ipython Of Python Code command line debugging tool , Can be seen as PDB Upgraded version .
2. Installation and use
install :pip install ipdb
Use :import ipdb;
ipdb.set_trace();
imperative :python -m pdb your_code.py
3. Common commands :
help (h)help、
Next order (n)next,
Inside the function (s)step in,
Breaking point (b)break:
Use b line_number(break) To the designated Line number position plus breakpoint . Use b file_name:line_number Method to the specified file ( The code that has not been executed may be in an external file ) Place a breakpoint at the specified line number in .
Resume execution (c)continue
r(return): If the function is too long , You can execute directly to the part that returns the result .
Skip a piece of code (j)jump: This should be followed by the line number of the code .
Context command (l)list: List the context of the current statement to be executed .l The execution of will record the status , Every time you type l Which line of code above will be followed .ll—— Show all the code of the current function , The result of each execution is the same .
Use w(where) You can print out the current line number location and context information .
List all parameters of the current function (a)argument You can print out the values of all parameters passed into the function .
Use p(print) and pp(pretty print) You can print the value of an expression .
clear breakpoints ——cl(clear), Use cl perhaps clear file:line_number clear breakpoints . If there are no parameters , Clear all breakpoints .
Use restart Restart the debugger , Breakpoints and other information will be retained .restart the truth is that run Another name for , Use run args Pass in parameters in the same way .
Use q Exit debugging , And clear all information .
summary : The above order is not ipdb All the orders of , Other commands need to refer to the documentation .
边栏推荐
- MySQL 操作
- AVL tree - binary lookup tree with equilibrium condition
- Amd rDNA 3 Navi 31 flagship GPU is said to be packaged in 3D v-cache and up to 384mb cache
- SAP BW 抽取层错误S:AA 821 (bukrs)
- I have added 101.132.179.94 to the white list of Oracle and still failed to Ping. What should I do
- Gobang (1)
- unity3d-Transform组件
- Promise入门
- Talk about the interface
- 观察者模式
猜你喜欢
随机推荐
Unity3d-小技巧
LeetCode精讲——1. 两数之和(难度:简单)
最大相连子序列和
unity3d-Camera
unity3d-MonoBehaviour基类
MySQL 错误信息 Errors
HeadFirst 状态模式 源码
MySQL 操作
SSH远程登录
About inheritance
SAP t-code transaction code set (continuously updated)
简单说一下进程
Mysql - page de données
【6月3号学习进度】
硬件课程设计:基于STM32的多功能播放器之图片浏览
"The following signature cannot be verified because there is no public key" solution
Unity3d monobehavior base class
Leetcode lecture - 1252 Number of odd cells (difficulty: simple)
SAP ABAP DUMP GETWA_ NOT_ Assigned pointer unassigned error
五子棋(一)









