Search code examples
pythondebuggingpycharmbreakpoints

How to debug breakpoint in pycharm at the end of file without adding a dummy line?


Normally, if I want to run a python file beginning-to-end in pycharm, but stop at the end so I can see all the variables etc., I add a line at the end of the file like

justadummyvar = 3

And attach a breakpoint to it.

Is there a way to just tell pycharm to debug run the file and stop at the end before flushing memory so I can get the same effect without changing the file contents?


Solution

  • The thing I was looking for is to right click within the editor and select Run File in Python Console. From there, you can see variables stored in memory and issue new commands after the entire script runs.

    You can re-run or run with debug with the buttons on the left of the little console window.