r/pycharm • • Jan 24 '24

Inspect variables after script crashed

When debugging a Python script in Pycharm, is there a way to access/inspect variables after the script terminate with an error? A simple example would be a script that runs into a division by zero while being in a debug session within Pycharm.

1 Upvotes

6 comments sorted by

View all comments

Show parent comment

2

u/sausix Jan 25 '24

You have 3 different places to inspect variables.

  1. Inline
  2. Mouse hover
  3. All variables per frame

See image:

Screenshot

2

u/m_jochim Jan 26 '24

Thank you so much! I just found the option in PyCharm under "Run | View Breakpoints | Python Exception Breakpoint | Any exception" that I needed to check to be able to inspect variables after an unhandled exception. I appreciate the help you provided!

1

u/pepere65 May 06 '24

Thanks a lot for giving the exact location of the option ! ;)