Check in interpreter if running a debug version of python

Christian Heimes lists at cheimes.de
Tue Jul 27 11:18:44 EDT 2010


> Starting with Python 2.7 and 3.2 you can do this:
> 
>>>> sysconfig.get_config_var("Py_DEBUG")
> 1
> 
> (returns None if the var doesn't exist)

IIRC sysconfig.get_config_var() still depends on parsing the pyconfig.h
file. This won't work on Windows because we are using project and config
settings of VisualStudio.




More information about the Python-list mailing list