import pdb; pdb.set_trace()
in the Python script.For example:
import sys
def log(args):
print(args)
def main(args):
log(args)
import pdb;pdb.set_trace()
main(sys.argv)
def log(args):
print(args)
def main(args):
log(args)
import pdb;pdb.set_trace()
main(sys.argv)
The execution will be stopped at the line:
Commandes of the python debug | Detail |
---|---|
s | Step in. |
n | Next. Step over. |
r | Return. Step out. |
l | List. This shows the code around the current location. |
a | Args. |
p | Print. Use this way: p some_variable |
c | Continue. |