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


Python sysconfig.get_path_names函数代码示例

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


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

示例1: sysconfig2

def sysconfig2():
    # import sysconfig module - Provide access to Python’s configuration information
    import sysconfig

    # returns an installation path corresponding to the path name
    print("Path Name : ", sysconfig.get_path("stdlib"))
    print()

    # returns a string that identifies the current platform.
    print("Current Platform : ", sysconfig.get_platform())
    print()

    # returns the MAJOR.MINOR Python version number as a string
    print("Python Version Number : ", sysconfig.get_python_version())
    print()

    # returns a tuple containing all path names
    print("Path Names : ", sysconfig.get_path_names())
    print()

    # returns a tuple containing all schemes
    print("Scheme Names : ", sysconfig.get_scheme_names())
    print()

    # returns the value of a single variable name.
    print("Variable name LIBDIR : ", sysconfig.get_config_var('LIBDIR'))

    # returns the value of a single variable name.
    print("Variable name LIBDEST : ", sysconfig.get_config_var('LIBDEST'))
开发者ID:mcclayac,项目名称:LearnSmart1,代码行数:29,代码来源:sysconfigExample.py

示例2: sysconfig_path

    def sysconfig_path(self, state, args, kwargs):
        if len(args) != 1:
            raise mesonlib.MesonException('sysconfig_path() requires passing the name of path to get.')
        path_name = args[0]
        valid_names = sysconfig.get_path_names()
        if path_name not in valid_names:
            raise mesonlib.MesonException('{} is not a valid path name {}.'.format(path_name, valid_names))

        # Get a relative path without a prefix, e.g. lib/python3.6/site-packages
        path = sysconfig.get_path(path_name, vars={'base': '', 'platbase': '', 'installed_base': ''})[1:]
        return ModuleReturnValue(path, [])
开发者ID:MathieuDuponchelle,项目名称:meson,代码行数:11,代码来源:python3.py

示例3: test_get_path_names

 def test_get_path_names(self):
     self.assertEqual(get_path_names(), sysconfig._SCHEME_KEYS)
开发者ID:ArneBab,项目名称:pypyjs,代码行数:2,代码来源:test_sysconfig.py

示例4:

# coding=utf-8
# 使用sysconfig

import sysconfig

print sysconfig.get_config_var('Py_ENABLE_SHARED')
print sysconfig.get_config_var('LIBDIR')
print sysconfig.get_config_vars('AR', "CXX")


print sysconfig.get_scheme_names()
print sysconfig.get_path_names()

print sysconfig.get_python_version()
print sysconfig.get_platform()

# return true if current python installation was built from source
print sysconfig.is_python_build()

print sysconfig.get_config_h_filename()
print sysconfig._get_makefile_filename()
开发者ID:jumper2014,项目名称:python-code-works,代码行数:21,代码来源:sysconfig_sample.py

示例5: test_get_path_names

 def test_get_path_names(self):
     self.assertEqual(get_path_names(), _SCHEMES.options('posix_prefix'))
开发者ID:Naddiseo,项目名称:cpython,代码行数:2,代码来源:test_sysconfig.py

示例6: Copyright

#!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2010 Doug Hellmann.  All rights reserved.
#
"""The names of the paths in a scheme.
"""
#end_pymotw_header

import sysconfig

for name in sysconfig.get_path_names():
    print name
开发者ID:artivee,项目名称:basc,代码行数:13,代码来源:sysconfig_get_path_names.py


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