6

When debugging a code in Pycharm is there a way to save current state before proceeding forward? That way I do not have to re-process everything that was already debugged if there is a bug downstream.

Thanks

dozyaustin
  • 611
  • 1
  • 6
  • 20

2 Answers2

2

While you can create a temporary debug template to make it easier to get back to the point you're at, it is not possible to save the entire state of a running debug session and modify code downstream. My only suggestion would be to run a new instance of your script and keep the debug open for the current session as it is.

J. Blackadar
  • 1,821
  • 1
  • 11
  • 18
  • 2
    Thanks ... I am too used to the convenience of notebooks (am a data scientist) ... but when I take code out of there and am turning it into "real code" .. I miss the ability to just work on a cell -- without rerunning everything upstream if I something bugs out. – dozyaustin Aug 16 '18 at 07:58
0

Based on your comment to the "correct" answer, it sound like what you really want is the interactiveness, which you can easily have in PyCharm in multiple ways.

Through debugger: One way is to set a break point, and then start executing code in the console from this state. You can execute a large selection of code or just one line at the time.

Without debugger: Another option is to just use the Python console to execute code interactively. Also here you can execute a large selection of code or one line at a time.

elgehelge
  • 2,014
  • 1
  • 19
  • 24