New submission from irdb: 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. ---------- components: Interpreter Core messages: 263135 nosy: irdb priority: normal severity: normal status: open title: make pdb.set_trace() accept debugger commands as arguments and run them after entering the debugger type: enhancement versions: Python 3.6 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26728> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com