[ACCEPTED]-How do I check if the python debug option is set from within a script-script-debugging
Accepted answer
you can use python -O
with the __debug__
variable
where -O
means 2 optimise. so __debug__
is false
-d
turns on debugging 1 for the parser, which is not what you want
Parser debug mode is enabled with -d
commandline 4 option or PYTHONDEBUG environment variable 3 and starting from python 2.6 is reflected 2 in sys.flags.debug
. But are you sure this is what you are 1 looking for?
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.