当前位置: 首页>>代码示例>>Python>>正文


Python sysconfig.get_path方法代码示例

本文整理汇总了Python中sysconfig.get_path方法的典型用法代码示例。如果您正苦于以下问题:Python sysconfig.get_path方法的具体用法?Python sysconfig.get_path怎么用?Python sysconfig.get_path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sysconfig的用法示例。


在下文中一共展示了sysconfig.get_path方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: getusersitepackages

# 需要导入模块: import sysconfig [as 别名]
# 或者: from sysconfig import get_path [as 别名]
def getusersitepackages():
    """Returns the user-specific site-packages directory path.

    If the global variable ``USER_SITE`` is not initialized yet, this
    function will also set it.
    """
    global USER_SITE
    user_base = getuserbase() # this will also set USER_BASE

    if USER_SITE is not None:
        return USER_SITE

    from sysconfig import get_path
    import os

    if sys.platform == 'darwin':
        from sysconfig import get_config_var
        if get_config_var('PYTHONFRAMEWORK'):
            USER_SITE = get_path('purelib', 'osx_framework_user')
            return USER_SITE

    USER_SITE = get_path('purelib', '%s_user' % os.name)
    return USER_SITE 
开发者ID:glmcdona,项目名称:meddle,代码行数:25,代码来源:site.py

示例2: _get_library_dir

# 需要导入模块: import sysconfig [as 别名]
# 或者: from sysconfig import get_path [as 别名]
def _get_library_dir():
    library_dir = None
    try:
        import sysconfig
        library_dir = sysconfig.get_path('purelib')
    except ImportError:
        pass  # i.e.: Only 2.7 onwards

    if library_dir is None or not os_path_exists(library_dir):
        for path in sys.path:
            if os_path_exists(path) and os.path.basename(path) == 'site-packages':
                library_dir = path
                break

    if library_dir is None or not os_path_exists(library_dir):
        library_dir = os.path.dirname(os.__file__)

    return library_dir


# Note: we can't call sysconfig.get_path from _NormPath (it deadlocks on Python 2.7) so, we
# need to get the library dir during module loading. 
开发者ID:fabioz,项目名称:PyDev.Debugger,代码行数:24,代码来源:pydevd_file_utils.py

示例3: getusersitepackages

# 需要导入模块: import sysconfig [as 别名]
# 或者: from sysconfig import get_path [as 别名]
def getusersitepackages():
    """Returns the user-specific site-packages directory path.

    If the global variable ``USER_SITE`` is not initialized yet, this
    function will also set it.
    """
    global USER_SITE
    user_base = getuserbase() # this will also set USER_BASE

    if USER_SITE is not None:
        return USER_SITE

    from sysconfig import get_path

    if sys.platform == 'darwin':
        from sysconfig import get_config_var
        if get_config_var('PYTHONFRAMEWORK'):
            USER_SITE = get_path('purelib', 'osx_framework_user')
            return USER_SITE

    USER_SITE = get_path('purelib', '%s_user' % os.name)
    return USER_SITE 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:24,代码来源:site.py

示例4: get_stdlib

# 需要导入模块: import sysconfig [as 别名]
# 或者: from sysconfig import get_path [as 别名]
def get_stdlib():
        paths = [
            sysconfig.get_path("stdlib"),
            sysconfig.get_path("platstdlib"),
        ]
        return set(filter(bool, paths)) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:8,代码来源:__init__.py

示例5: get_path

# 需要导入模块: import sysconfig [as 别名]
# 或者: from sysconfig import get_path [as 别名]
def get_path(name):
        if name not in ('platlib', 'purelib'):
            raise ValueError("Name must be purelib or platlib")
        return get_python_lib(name=='platlib') 
开发者ID:jpush,项目名称:jbox,代码行数:6,代码来源:py31compat.py

示例6: _get_purelib

# 需要导入模块: import sysconfig [as 别名]
# 或者: from sysconfig import get_path [as 别名]
def _get_purelib():
        return get_path("purelib") 
开发者ID:jpush,项目名称:jbox,代码行数:4,代码来源:bdist_egg.py

示例7: get_path

# 需要导入模块: import sysconfig [as 别名]
# 或者: from sysconfig import get_path [as 别名]
def get_path(name):
        if name not in ('platlib', 'purelib'):
            raise ValueError("Name must be purelib or platlib")
        return get_python_lib(name == 'platlib') 
开发者ID:sofia-netsurv,项目名称:python-netsurv,代码行数:6,代码来源:py31compat.py


注:本文中的sysconfig.get_path方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。