Access to Python’s configuration information

Configuration information of Python's installation can be accessed by the sysconfig module. For example the list of installation paths and the configuration variables specific to the installation platform.
The sysconfig module provides the following functions to access Configuration variables
With no arguments, this function returns a dictionary of all configuration variables relevant for the current platform.
>>> import sysconfig
>>> sysconfig.get_config_vars()
{'prefix': 'E:\\python37', 'exec_prefix': 'E:\\python37', 'py_version': '3.7.2', 'py_version_short':
'3.7', 'py_version_nodot': '37', 'installed_base': 'E:\\python37', 'base': 'E:\\python37',
'installed_platbase': 'E:\\python37', 'platbase': 'E:\\python37', 'projectbase': 'E:\\python37',
'abiflags': '', 'LIBDEST': 'E:\\python37\\Lib', 'BINLIBDEST': 'E:\\python37\\Lib', 'INCLUDEPY':
'E:\\python37\\Include', 'EXT_SUFFIX': '.pyd', 'EXE': '.exe', 'VERSION': '37', 'BINDIR':
'E:\\python37', 'SO': '.pyd', 'userbase': 'C:\\Users\\acer\\AppData\\Roaming\\Python', 'srcdir':
'E:\\python37'}
With arguments, return a list of values for specific keys. For each argument, if the value is not found, return None.
>>> sysconfig.get_config_vars('base','EXE')
['E:\\python37', '.exe']
This function returns the value of a single variable name. This is equivalent to get_config_vars().get(name). If name is not found, the function returns None.
>>> sysconfig.get_config_var('VERSION')
'37'
>>> sysconfig.get_config_var('srcdir')
'E:\\python37'
Python uses an installation scheme that differs depending on the platform and on the installation options. Following schemes are currently supported:
This function returns a tuple containing all path names currently supported in sysconfig.
>>> sysconfig.get_path_names()
('stdlib', 'platstdlib', 'purelib', 'platlib', 'include', 'scripts', 'data')
Each scheme is composed of a various paths having unique identifier. The path names are as below:
This function returns installation path corresponding to the path name, from the install scheme named scheme.
>>> sysconfig.get_path('include')
'E:\\python37\\Include'
>>> sysconfig.get_platform()
'win-amd64'
This function returns the MAJOR.MINOR Python version number as a string.
This function returns a string that identifies the current platform.
The configuration variables and their values can also be accessed using sysconfig module with –m option.
E:\python37>python -m sysconfig
Platform: "win-amd64"
Python version: "3.7"
Current installation scheme: "nt"
Paths:
   data = "E:\python37"
   include = "E:\python37\Include"
   platinclude = "E:\python37\Include"
   platlib = "E:\python37\Lib\site-packages"
   platstdlib = "E:\python37\Lib"
   purelib = "E:\python37\Lib\site-packages"
   scripts = "E:\python37\Scripts"
   stdlib = "E:\python37\Lib"
Variables:
   BINDIR = "E:\python37"
   BINLIBDEST = "E:\python37\Lib"
   EXE = ".exe"
   EXT_SUFFIX = ".pyd"
   INCLUDEPY = "E:\python37\Include"
   LIBDEST = "E:\python37\Lib"
   SO = ".pyd"
   VERSION = "37"
   abiflags = ""
   base = "E:\python37"
   exec_prefix = "E:\python37"
   installed_base = "E:\python37"
   installed_platbase = "E:\python37"
   platbase = "E:\python37"
   prefix = "E:\python37"
   projectbase = "E:\python37"
   py_version = "3.7.2"
   py_version_nodot = "37"
   py_version_short = "3.7"
   srcdir = "E:\python37"
   userbase = "C:\Users\acer\AppData\Roaming\Python"