Detecting whether code is running standalone or in IDE.

Things change over time and I was wondering what the current best practice is to add conditional code that switches based on whether the program is running standalone (from the "command line") or whether it is running in the the PyCharm IDE. I will buy anybody a beverage of their choice if I could even go so far as determining if I am running or debugging in the IDE.

Please sign in to leave a comment.