Check if program runs in Debug mode

I use the PyCharm IDE for Python programming. Is there a possibility to check, whether I'm in debugging mode or not when I run my program? I use pyplot as plt and want a Figure only to be shown if I