Message263135
I usually insert the following line in the middle of code to start the debugger from there:
import pdb; pdb.set_trace()
More often than not, I need to run some commands immediately after entering the debug mode, e.g. watch (display) some variables, create some additional break points, etc.
AFAIK currently you have to enter those commands manually on each run and there is no simple way to pass those commands from the source code.
Of-course one can invoke pdb as a script ("python3 -m pdb -c ...") and pass the desired commands to the script. But still using pdb.set_trace() is a popular method and I think it would be very useful to have set_trace() accept a list of strings as arguments and execute them right after entering the debugger. |
|
Date |
User |
Action |
Args |
2016-04-10 12:22:09 | THRlWiTi | set | recipients:
+ THRlWiTi |
2016-04-10 12:22:09 | THRlWiTi | set | messageid: <1460290929.06.0.199912788484.issue26728@psf.upfronthosting.co.za> |
2016-04-10 12:22:09 | THRlWiTi | link | issue26728 messages |
2016-04-10 12:22:08 | THRlWiTi | create | |
|