Tuesday, October 23, 2018

pycharm debug detecting

I use pycharm. I have a program that works through tasks in parallel. When I'm debugging, however, I want to work though tasks in series. So I have this check to know if I'm running in debug:

    IS_DEBUG = True if __loader__.path.endswith('pydev/pydevd.py') else False

or, you can just use:

 __debug__