[ACCEPTED]-How do I check if the python debug option is set from within a script-script-debugging

Accepted answer
Score: 13

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

Score: 7

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?

More Related questions