how do I know if I'm using a debug build of python

bgeddy bgeddy at home.havin.a.break
Fri Apr 18 04:59:16 CEST 2008


Tim Mitchell wrote:
> Hi,
> 
> A quick question:
> Is there any way for a python script to know if it's being executed by a 
> debug build of python (python_d.exe) instead of python?
> 
> Thanks
> Tim
> 
Not sure what this returns in Windows as I run Linux but this returns to 
namer of the python executable for my setup - maybe its what you want.

import sys
print sys.executable

- will print out the name of the python executable.



More information about the Python-list mailing list