When there is no ide at hand and you are worried about Python debugging, you can refer to this article. (PDB command debugging)
Reference: http://docs.python.org/library/pdb.html
And (PDB) Help
First you choose to run the py
Python-m pdb myscript. py
(PDB) will automatically stop at the first line, waiting for debugging, then you can look at the help
(PDB) h
Describe these key commands
> Breakpoint settings
(PDB) B 10 # Set the breakpoint to the 10th rows of this py
Or (PDB) B ots. py: 20 # Set the breakpoint to ots. py row 20th
Delete breakpoint (PDB) B # view the breakpoint number
(PDB) Cl 2 # Delete 2nd breakpoints
> RUN
(PDB) N # single-step operation
(PDB) s # click it to run, that is, click Next, AND THE METHOD
(PDB) C # jump to the next breakpoint
> View
(PDB) P Param # view the current variable value
(PDB) L # view the code running somewhere
(PDB) A # view all intra-stack variables
> If the debugging is in the command line:
Import PDB
Def TT ():
PDB. set_trace ()
For I in range (1, 5 ):
Print I
>>> TT ()
# N p c is supported here
> (3) TT ()
(PDB) N