(*args)
With no arguments, return a dictionary of all configuration
    variables relevant for the current platform.

    On Unix, this means every variable defined in Python's installed Makefile;
    On Windows and Mac OS it's a much smaller set.

    With arguments, return a list of values that result from looking up
    each argument in the configuration variable dictionary.
With no arguments, return a dictionary of all configuration
    variables relevant for the current platform.
With no arguments return a dictionary of all configuration variables relevant for the current platform .
def get_config_vars(*args):
    """With no arguments, return a dictionary of all configuration
    variables relevant for the current platform.

    On Unix, this means every variable defined in Python's installed Makefile;
    On Windows and Mac OS it's a much smaller set.

    With arguments, return a list of values that result from looking up
    each argument in the configuration variable dictionary.
    """
    import re
    global _CONFIG_VARS
    if _CONFIG_VARS is None:
        _CONFIG_VARS = {}
        # Normalized versions of prefix and exec_prefix are handy to have;
        # in fact, these are the standard versions used most places in the
        # Distutils.
        _CONFIG_VARS['prefix'] = _PREFIX
        _CONFIG_VARS['exec_prefix'] = _EXEC_PREFIX
        _CONFIG_VARS['py_version'] = _PY_VERSION
        _CONFIG_VARS['py_version_short'] = _PY_VERSION_SHORT
        _CONFIG_VARS['py_version_nodot'] = _PY_VERSION[0] + _PY_VERSION[2]
        _CONFIG_VARS['base'] = _PREFIX
        _CONFIG_VARS['platbase'] = _EXEC_PREFIX
        _CONFIG_VARS['projectbase'] = _PROJECT_BASE

        # GCC(mingw) use posix build system
        posix_build = None
        if os.name == 'posix':
            posix_build = True
        else:
            if os.name in ('nt', 'os2'):
                if sys.version.find('GCC') >= 0:
                    posix_build = True
                else:
                    posix_build = False
        if posix_build == False:
            _init_non_posix(_CONFIG_VARS)
        if posix_build == True:
            _init_posix(_CONFIG_VARS)

        # Setting 'userbase' is done below the call to the
        # init function to enable using 'get_config_var' in
        # the init-function.
        _CONFIG_VARS['userbase'] = _getuserbase()

        if 'srcdir' not in _CONFIG_VARS:
            _CONFIG_VARS['srcdir'] = _PROJECT_BASE

        # Convert srcdir into an absolute path if it appears necessary.
        # Normally it is relative to the build directory.  However, during
        # testing, for example, we might be running a non-installed python
        # from a different directory.
        if _PYTHON_BUILD and posix_build == True:
            base = _PROJECT_BASE
            try:
                cwd = os.getcwd()
            except OSError:
                cwd = None
            if (not os.path.isabs(_CONFIG_VARS['srcdir']) and
                base != cwd):
                # srcdir is relative and we are not in the same directory
                # as the executable. Assume executable is in the build
                # directory and make srcdir absolute.
                srcdir = os.path.join(base, _CONFIG_VARS['srcdir'])
                _CONFIG_VARS['srcdir'] = os.path.normpath(srcdir)

        # OS X platforms require special customization to handle
        # multi-architecture, multi-os-version installers
        if sys.platform == 'darwin':
            import _osx_support
            _osx_support.customize_config_vars(_CONFIG_VARS)

    if args:
        vals = []
        for name in args:
            vals.append(_CONFIG_VARS.get(name))
        return vals
    else:
        return _CONFIG_VARS
def get_config_vars ( * args ) : import re global _CONFIG_VARS if _CONFIG_VARS is None : _CONFIG_VARS = { } # Normalized versions of prefix and exec_prefix are handy to have; # in fact, these are the standard versions used most places in the # Distutils. _CONFIG_VARS [ 'prefix' ] = _PREFIX _CONFIG_VARS [ 'exec_prefix' ] = _EXEC_PREFIX _CONFIG_VARS [ 'py_version' ] = _PY_VERSION _CONFIG_VARS [ 'py_version_short' ] = _PY_VERSION_SHORT _CONFIG_VARS [ 'py_version_nodot' ] = _PY_VERSION [ 0 ] + _PY_VERSION [ 2 ] _CONFIG_VARS [ 'base' ] = _PREFIX _CONFIG_VARS [ 'platbase' ] = _EXEC_PREFIX _CONFIG_VARS [ 'projectbase' ] = _PROJECT_BASE # GCC(mingw) use posix build system posix_build = None if os . name == 'posix' : posix_build = True else : if os . name in ( 'nt' , 'os2' ) : if sys . version . find ( 'GCC' ) >= 0 : posix_build = True else : posix_build = False if posix_build == False : _init_non_posix ( _CONFIG_VARS ) if posix_build == True : _init_posix ( _CONFIG_VARS ) # Setting 'userbase' is done below the call to the # init function to enable using 'get_config_var' in # the init-function. _CONFIG_VARS [ 'userbase' ] = _getuserbase ( ) if 'srcdir' not in _CONFIG_VARS : _CONFIG_VARS [ 'srcdir' ] = _PROJECT_BASE # Convert srcdir into an absolute path if it appears necessary. # Normally it is relative to the build directory.  However, during # testing, for example, we might be running a non-installed python # from a different directory. if _PYTHON_BUILD and posix_build == True : base = _PROJECT_BASE try : cwd = os . getcwd ( ) except OSError : cwd = None if ( not os . path . isabs ( _CONFIG_VARS [ 'srcdir' ] ) and base != cwd ) : # srcdir is relative and we are not in the same directory # as the executable. Assume executable is in the build # directory and make srcdir absolute. srcdir = os . path . join ( base , _CONFIG_VARS [ 'srcdir' ] ) _CONFIG_VARS [ 'srcdir' ] = os . path . normpath ( srcdir ) # OS X platforms require special customization to handle # multi-architecture, multi-os-version installers if sys . platform == 'darwin' : import _osx_support _osx_support . customize_config_vars ( _CONFIG_VARS ) if args : vals = [ ] for name in args : vals . append ( _CONFIG_VARS . get ( name ) ) return vals else : return _CONFIG_VARS