[Python] updating python code in the middle of debugging

Discussão em 'Python' iniciado por Stack, Março 10, 2025.

  1. Stack

    Stack Membro Participativo

    I often have to debug the python code by pdb debugger. It happens that it fails due to program errors that should be corrected. The problem is that I have to update the python code and restart the debugger to reach the point where the problem ealier ocurred. It takes time for not trivial programs. Is there a way to keep that python debugger state of execution and have the option to change the code being debugged? Alternatively, is there a way to make some kind of results snapshot of python program time consuming initialication and then try debuggind the code? In the later case I want to restart the program from the snapshot and continue with the updated part of python program.

    For debugging I use command line pdb initiated by the breakpoint() or pdb.set_trace() commands.

    Continue reading...

Compartilhe esta Página