I'd like to take some actions in my code, conditioned on whether the PyCharm debugger is attached and running — e.g., I've launched my code using the IDE's "Debug" command; something like
if pycharm_debugger_is_running:
do_something()
else:
do_another_thing()
Is there a way to do that?