The functionality of the Idel ribbon that used to be used under Windows has been debugged by the Python program, which has not been debugged under Linux. (many times just print) to find out from the Internet ~
Method:
Copy the Code code as follows:
PYTHON-M PDB a.py
a.py is a python file.
Common commands in (PDB) mode:
Q
Exit Debug
H is Help, print all commands
H W
The meaning of the Print command W
N
Executes the current line until it reaches the next line or until it returns
S
Executes the current row, stopping at the first possible moment (such as having a function call on the current line). It differs from N (next) in that the current line has a function call when s (step) stops the execution of the current row and calls that function, and N does not stop until the calculation completes the line (to the next line).
B (Reak) [[Filename:]lineno | function[, Condition]
Sets a breakpoint, which can be a line number or function. such as B, b foo, b foo,n = = 5, and finally set a breakpoint at the entrance to the function foo (), but only if the value of n is 5 o'clock. When the B command has no parameters, all breakpoints are printed.
TB (reak) [[Filename:]lineno | function[, Condition]
A temporary breakpoint, hit only once.
disable [Bpnumber [Bpnumber ...]
Invalidates the breakpoint (of the Pointing line)
Enable [Bpnumber [Bpnumber ...]
Make breakpoints on the specified line valid
C
Continue executing the program until the next breakpoint is encountered
W
Where, where the current execution point is printed
l [First, [, last]]
Output source near the current line
P expression
Executes an expression when printing its value.
A (RGS)
Print the current function's parameters and their values
<直接回车>
Repeat the last command
When you encounter a command that the PDB does not recognize, it is executed as a Python expression. If you want to perform the expression, add the front top! characters, such as!n = = 5
Multiple debug commands can be written on a single line, separated by two semicolons, such as s;; S