I have python extension code that I need to cross-platform compile, and to do so, I need to be able to find the python include folder.  On Linux and Mac OSX, I can do python-config --include and it gives me something like -I/Library/Frameworks/Python.framework/Versions/6.3/include/python2.6.  This is fine and dandy, except that my Windows python distro doesn't have python-config.  Is there a开发者_运维技巧n easy way, through python code, of finding where it thinks the include folder is?  For numpy, this snippet does the job: 
try:
    numpy_include = numpy.get_include()
except AttributeError:
    numpy_include = numpy.get_numpy_include()
Is there an analogous method for the python include folder?
You can try this:
>>> from distutils import sysconfig
>>> sysconfig.get_python_inc()
'/usr/include/python2.6'
>>> sysconfig.get_python_inc(plat_specific=True)
'/usr/include/python2.6'
Note: I found this out by looking at python-config source.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论