本文整理汇总了Python中platform.python_build方法的典型用法代码示例。如果您正苦于以下问题:Python platform.python_build方法的具体用法?Python platform.python_build怎么用?Python platform.python_build使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类platform
的用法示例。
在下文中一共展示了platform.python_build方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import platform [as 别名]
# 或者: from platform import python_build [as 别名]
def __init__(self, base_dir, config, backup_time, seed_uri, argv=None):
StateBase.__init__(self, base_dir, config)
self.base_dir = base_dir
self.state['backup'] = True
self.state['completed'] = False
self.state['name'] = backup_time
self.state['method'] = config.backup.method
self.state['path'] = base_dir
self.state['cmdline'] = argv
self.state['config'] = config.dump()
self.state['version'] = config.version
self.state['git_commit'] = config.git_commit
self.state['host'] = {
'hostname': platform.node(),
'uname': platform.uname(),
'python': {
'build': platform.python_build(),
'version': platform.python_version()
}
}
self.state['seed'] = {
'uri': seed_uri.str(),
'replset': seed_uri.replset
}
self.init()
示例2: pytest_benchmark_generate_machine_info
# 需要导入模块: import platform [as 别名]
# 或者: from platform import python_build [as 别名]
def pytest_benchmark_generate_machine_info():
python_implementation = platform.python_implementation()
python_implementation_version = platform.python_version()
if python_implementation == 'PyPy':
python_implementation_version = '%d.%d.%d' % sys.pypy_version_info[:3]
if sys.pypy_version_info.releaselevel != 'final':
python_implementation_version += '-%s%d' % sys.pypy_version_info[3:]
return {
"node": platform.node(),
"processor": platform.processor(),
"machine": platform.machine(),
"python_compiler": platform.python_compiler(),
"python_implementation": python_implementation,
"python_implementation_version": python_implementation_version,
"python_version": platform.python_version(),
"python_build": platform.python_build(),
"release": platform.release(),
"system": platform.system(),
"cpu": get_cpu_info(),
}
示例3: get_system_info
# 需要导入模块: import platform [as 别名]
# 或者: from platform import python_build [as 别名]
def get_system_info():
return """
System Details:
Version: %s
Compiler: %s
Build: %s
Platform: %s
System: %s
Node: %s
Release: %s
Version: %s
""" % (
platform.python_version(),
platform.python_compiler(),
platform.python_build(),
platform.platform(),
platform.system(),
platform.node(),
platform.release(),
platform.version(),
)
示例4: check_python
# 需要导入模块: import platform [as 别名]
# 或者: from platform import python_build [as 别名]
def check_python():
print('----------Python Info----------')
print('Version :', platform.python_version())
print('Compiler :', platform.python_compiler())
print('Build :', platform.python_build())
print('Arch :', platform.architecture())
示例5: python_version_string
# 需要导入模块: import platform [as 别名]
# 或者: from platform import python_build [as 别名]
def python_version_string():
"""We use it to generate per python folder name, where
we will install all packages.
"""
if platform.python_implementation() == 'PyPy':
version_info = sys.pypy_version_info
else:
version_info = sys.version_info
version_string = '{v.major}.{v.minor}.{v.micro}'.format(v=version_info)
build, _ = platform.python_build()
build = build.replace(':', '_') # windows do not understand `:` in path
return '{}-{}-{}'.format(platform.python_implementation(), version_string, build)
示例6: getSoftwareInfo
# 需要导入模块: import platform [as 别名]
# 或者: from platform import python_build [as 别名]
def getSoftwareInfo ():
""" Get software info for inclusion into warcinfo """
return {
'platform': platform.platform (),
'python': {
'implementation': platform.python_implementation(),
'version': platform.python_version (),
'build': platform.python_build ()
},
'self': getRequirements (__package__)
}
示例7: __init__
# 需要导入模块: import platform [as 别名]
# 或者: from platform import python_build [as 别名]
def __init__(self):
super().__init__()
self['revscoring_version'] = __version__
self['platform'] = platform.platform()
self['machine'] = platform.machine()
self['version'] = platform.version()
self['system'] = platform.system()
self['processor'] = platform.processor()
self['python_build'] = platform.python_build()
self['python_compiler'] = platform.python_compiler()
self['python_branch'] = platform.python_branch()
self['python_implementation'] = platform.python_implementation()
self['python_revision'] = platform.python_revision()
self['python_version'] = platform.python_version()
self['release'] = platform.release()
示例8: print_environment
# 需要导入模块: import platform [as 别名]
# 或者: from platform import python_build [as 别名]
def print_environment():
"""For reporting bugs - spits out the user's environment"""
import sys
version = {}
for pkg in 'moldesign IPython ipywidgets jupyter matplotlib numpy docker pyccc distutils' \
'nbmolviz jupyter_client jupyter_core pint Bio openbabel simtk pyscf pip setuptools'\
.split():
try:
module = __import__(pkg)
except ImportError as e:
version[pkg] = str(e)
else:
try:
version[pkg] = module.__version__
except AttributeError as e:
version[pkg] = str(e)
env = {'platform': sys.platform,
'version': sys.version,
'prefix': sys.prefix}
try:
import platform
env['machine'] = platform.machine()
env['linux'] = platform.linux_distribution()
env['mac'] = platform.mac_ver()
env['windows'] = platform.win32_ver()
env['impl'] = platform.python_implementation()
env['arch'] = platform.architecture()
env['system'] = platform.system()
env['python_build'] = platform.python_build()
env['platform_version'] = platform.version()
except Exception as e:
env['platform_exception'] = str(e)
print(json.dumps({'env': env,
'versions': version}))
示例9: test_python_build
# 需要导入模块: import platform [as 别名]
# 或者: from platform import python_build [as 别名]
def test_python_build(self):
res = platform.python_build()
示例10: __init__
# 需要导入模块: import platform [as 别名]
# 或者: from platform import python_build [as 别名]
def __init__(self, parent = None, aw = None):
super(platformDlg,self).__init__(parent, aw)
self.setModal(True)
self.setWindowTitle(QApplication.translate("Form Caption","Artisan Platform", None))
platformdic = {}
platformdic["Architecture"] = str(platform.architecture())
platformdic["Machine"] = str(platform.machine())
platformdic["Platform name"] = str(platform.platform())
platformdic["Processor"] = str(platform.processor())
platformdic["Python Build"] = str(platform.python_build())
platformdic["Python Compiler"] = str(platform.python_compiler())
platformdic["Python Branch"] = str(platform.python_branch())
platformdic["Python Implementation"] = str(platform.python_implementation())
platformdic["Python Revision"] = str(platform.python_revision())
platformdic["Release"] = str(platform.release())
platformdic["System"] = str(platform.system())
platformdic["Version"] = str(platform.version())
platformdic["Python version"] = str(platform.python_version())
system = str(platform.system())
if system == "Windows":
platformdic["Win32"] = str(platform.win32_ver())
elif system == "Darwin":
platformdic["Mac"] = str(platform.mac_ver())
elif system == "Linux":
platformdic["Linux"] = str(platform.linux_distribution())
platformdic["Libc"] = str(platform.libc_ver())
htmlplatform = "<b>version =</b> " + __version__ + " (" + __revision__ + ")<br>"
for key in sorted(platformdic):
htmlplatform += "<b>" + key + " = </b> <i>" + platformdic[key] + "</i><br>"
platformEdit = QTextEdit()
platformEdit.setHtml(htmlplatform)
platformEdit.setReadOnly(True)
layout = QVBoxLayout()
layout.addWidget(platformEdit)
self.setLayout(layout)
示例11: version_details
# 需要导入模块: import platform [as 别名]
# 或者: from platform import python_build [as 别名]
def version_details():
from ansible import __version__ as ansible_version # noqa
from infrared import __version__ # noqa
python_version = platform.python_version()
python_revision = ', '.join(platform.python_build())
return "{__version__} (" \
"ansible-{ansible_version}, " \
"python-{python_version})".format(**locals())
示例12: initialize_lib
# 需要导入模块: import platform [as 别名]
# 或者: from platform import python_build [as 别名]
def initialize_lib():
global BCL_INSTALL_DIR, BCL_DATA_DIR, BITCOINLIB_VERSION
instlogfile = Path(BCL_DATA_DIR, 'install.log')
if instlogfile.exists():
return
with instlogfile.open('w') as f:
install_message = "BitcoinLib installed, check further logs in bitcoinlib.log\n\n" \
"If you remove this file all settings will be reset again to the default settings. " \
"This might be usefull after an update or when problems occur.\n\n" \
"Installation parameters. Include this parameters when reporting bugs and issues:\n" \
"Bitcoinlib version: %s\n" \
"Installation date : %s\n" \
"Python : %s\n" \
"Compiler : %s\n" \
"Build : %s\n" \
"OS Version : %s\n" \
"Platform : %s\n" % \
(BITCOINLIB_VERSION, datetime.now().isoformat(), platform.python_version(),
platform.python_compiler(), platform.python_build(), platform.version(), platform.platform())
f.write(install_message)
# Copy data and settings file
from shutil import copyfile
for file in Path(BCL_INSTALL_DIR, 'data').iterdir():
if file.suffix not in ['.ini', '.json']:
continue
copyfile(str(file), str(Path(BCL_DATA_DIR, file.name)))
# Initialize library
示例13: display_platform_information
# 需要导入模块: import platform [as 别名]
# 或者: from platform import python_build [as 别名]
def display_platform_information():
"""
Display platform information.
"""
import platform
output_string = '\n-- INFORMATION: PLATFORM & OS ---------\n'
try:
output_string = add_param_to_output(output_string,
'OS',
platform.platform())
output_string = add_param_to_output(output_string,
'OS release version',
platform.version())
output_string = add_param_to_output(output_string,
'machine',
platform.machine())
output_string = add_param_to_output(output_string,
'node',
platform.node())
output_string = add_param_to_output(output_string,
'python version',
platform.python_version())
output_string = add_param_to_output(output_string,
'python build',
platform.python_build())
output_string = add_param_to_output(output_string,
'python compiler',
platform.python_compiler())
except Exception:
output_string += 'Some platform information cannot be displayed\n'
output_string += '----------------------------------------'
neon_logger.display(output_string)
示例14: get_machine_infos
# 需要导入模块: import platform [as 别名]
# 或者: from platform import python_build [as 别名]
def get_machine_infos(self):
"""the function retrieves some information about the host and returns them as a list"""
infos = {}
infos["Machine"] = platform.machine()
infos["Hostname"] = platform.node()
infos["Platform"] = platform.platform()
infos["Python Build"] = platform.python_build()
infos["Python Compiler"] = platform.python_compiler()
infos["Python Implementation"] = platform.python_implementation()
infos["Python Version"] = platform.python_version()
infos["Release"] = platform.release()
infos["Libc Version"] = platform.libc_ver()
return infos
示例15: get_user_agent
# 需要导入模块: import platform [as 别名]
# 或者: from platform import python_build [as 别名]
def get_user_agent():
sdk_version = "CognitePythonSDK/{}".format(get_current_sdk_version())
python_version = "{}/{} ({};{})".format(
platform.python_implementation(), platform.python_version(), platform.python_build(), platform.python_compiler()
)
os_version_info = [platform.release(), platform.machine(), platform.architecture()[0]]
os_version_info = [s for s in os_version_info if s] # Ignore empty strings
os_version_info = "-".join(os_version_info)
operating_system = "{}/{}".format(platform.system(), os_version_info)
return "{} {} {}".format(sdk_version, python_version, operating_system)