1

In debian/CentOS systems, python's excutable, header and library files are organized like:

/usr/(local/|)/bin/python
/usr/(local/|)/include/python-$version$/
/usr/(local/|)/libs

But on Windows, the folder structure is a bit different

C:\\Program\ Files\\Python$version$\\python.exe
C:\\Program\ Files\\Python$version$\\include\
C:\\Program\ Files\\Python$version$\\libs

the sys module can tell me where the executable is in sys.executable and the general folder where all python files are installed in sys.base_prefix, can it or some other module tell me where the header files are?

Catherine Holloway
  • 739
  • 1
  • 7
  • 20

1 Answers1

3

This information is available in distutils.sysconfig and sysconfig, i.e.:

prior to python 3.2

from distutils import sysconfig
sysconfig.get_python_inc()

more recent pythons:

import sysconfig
sysconfig.get_config_var("INCLUDEPY")
Catherine Holloway
  • 739
  • 1
  • 7
  • 20