本文整理汇总了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'))
示例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, [])
示例3: test_get_path_names
def test_get_path_names(self):
self.assertEqual(get_path_names(), sysconfig._SCHEME_KEYS)
示例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()
示例5: test_get_path_names
def test_get_path_names(self):
self.assertEqual(get_path_names(), _SCHEMES.options('posix_prefix'))
示例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