1

I regularly use Spyder's built in debugging. I find that whilst I am stepping through a program, I often want to make changes to the source. However, this will put the current line in the code editor (the line of code whose line number is bold) out of wack with the line being run by ipdb in the ipython console.

Whilst ipdb seems to continue to work fine, makes me nervous that I shouldn't be editing files whilst debugging and I will end up with unexpected behaviour.

My questions are:

Should I be able to edit files whilst debugging in Spyder?

If so, what is the best way to do this?

If not, does PyCharm or another IDE good for scientific computing support this?

Many thanks.

Max888
  • 3,089
  • 24
  • 55

1 Answers1

0

Yes, you should be able to do that. The editing and saving will just edit the original file and not the currently running code. It will just edit your running file if you have saved the file and re-run the python debugger command. It is not specific to Spyder, but to the ipdb / pdb commands, so it would be the same in other editors like PyCharm.

JackJadon
  • 148
  • 7
  • I've investigated further, and when I edit a file during debugging hitting the enter key will change focus to the ipdb console. This makes it a pain to edit a file and makes me think that Spyder does not expect me to be doing this - thus I shouldn't be. – Max888 Apr 17 '18 at 14:15
  • (*Spyder maintainer here*) So every `Enter` you press on the Editor is making it change focus to the ipbd console? If that's the case, it is a bug because we didn't design things to be like that. – Carlos Cordoba Apr 17 '18 at 16:00