Hi,
I would like my code when executing to know that I am running in debug mode. __debug__ only distinguishes running for optomization or not. Is there another globally visible variable I could use?
Thanks,
Lin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I would like my code when executing to know that I am running in debug mode. __debug__ only distinguishes running for optomization or not. Is there another globally visible variable I could use?
Thanks,
Lin
There's no real global variable to identify that... but a way to detect it would be:
def IsInDebugMode():
....try:
........import pydevd_comm
....except ImportError:
........return False
....else:
........return pydevd_comm.GetGlobalDebugger() is not None
Cheers,
Fabio