本文整理汇总了Python中platform.python_branch方法的典型用法代码示例。如果您正苦于以下问题:Python platform.python_branch方法的具体用法?Python platform.python_branch怎么用?Python platform.python_branch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类platform
的用法示例。
在下文中一共展示了platform.python_branch方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import platform [as 别名]
# 或者: from platform import python_branch [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()
示例2: __init__
# 需要导入模块: import platform [as 别名]
# 或者: from platform import python_branch [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)
示例3: _create
# 需要导入模块: import platform [as 别名]
# 或者: from platform import python_branch [as 别名]
def _create(self):
import platform
def get_version(moduleName):
""" Extract the current version of a python module """
if moduleName == "cvxopt":
#special case b/c cvxopt can be weird...
try:
mod = __import__("cvxopt.info")
return str(mod.info.version)
except Exception: pass # try the normal way below
try:
mod = __import__(moduleName)
return str(mod.__version__)
except ImportError: # pragma: no cover
return "missing" # pragma: no cover
except AttributeError: # pragma: no cover
return "ver?" # pragma: no cover
except Exception: # pragma: no cover
return "???" # pragma: no cover
colHeadings = ('Quantity', 'Value')
formatters = ('Bold', 'Bold')
#custom latex header for maximum width imposed on 2nd col
latex_head = "\\begin{tabular}[l]{|c|p{3in}|}\n\hline\n"
latex_head += "\\textbf{Quantity} & \\textbf{Value} \\\\ \hline\n"
table = _ReportTable(colHeadings, formatters,
customHeader={'latex': latex_head})
#Python package information
from .._version import __version__ as pyGSTi_version
table.addrow(("pyGSTi version", str(pyGSTi_version)), (None, 'Verbatim'))
packages = ['numpy', 'scipy', 'matplotlib', 'ply', 'cvxopt', 'cvxpy',
'nose', 'PIL', 'psutil']
for pkg in packages:
table.addrow((pkg, get_version(pkg)), (None, 'Verbatim'))
#Python information
table.addrow(("Python version", str(platform.python_version())), (None, 'Verbatim'))
table.addrow(("Python type", str(platform.python_implementation())), (None, 'Verbatim'))
table.addrow(("Python compiler", str(platform.python_compiler())), (None, 'Verbatim'))
table.addrow(("Python build", str(platform.python_build())), (None, 'Verbatim'))
table.addrow(("Python branch", str(platform.python_branch())), (None, 'Verbatim'))
table.addrow(("Python revision", str(platform.python_revision())), (None, 'Verbatim'))
#Platform information
(system, _, release, version, machine, processor) = platform.uname()
table.addrow(("Platform summary", str(platform.platform())), (None, 'Verbatim'))
table.addrow(("System", str(system)), (None, 'Verbatim'))
table.addrow(("Sys Release", str(release)), (None, 'Verbatim'))
table.addrow(("Sys Version", str(version)), (None, 'Verbatim'))
table.addrow(("Machine", str(machine)), (None, 'Verbatim'))
table.addrow(("Processor", str(processor)), (None, 'Verbatim'))
table.finish()
return table
示例4: test_sys_version
# 需要导入模块: import platform [as 别名]
# 或者: from platform import python_branch [as 别名]
def test_sys_version(self):
# Old test.
for input, output in (
('2.4.3 (#1, Jun 21 2006, 13:54:21) \n[GCC 3.3.4 (pre 3.3.5 20040809)]',
('CPython', '2.4.3', '', '', '1', 'Jun 21 2006 13:54:21', 'GCC 3.3.4 (pre 3.3.5 20040809)')),
('IronPython 1.0.60816 on .NET 2.0.50727.42',
('IronPython', '1.0.60816', '', '', '', '', '.NET 2.0.50727.42')),
('IronPython 1.0 (1.0.61005.1977) on .NET 2.0.50727.42',
('IronPython', '1.0.0', '', '', '', '', '.NET 2.0.50727.42')),
):
# branch and revision are not "parsed", but fetched
# from sys.subversion. Ignore them
(name, version, branch, revision, buildno, builddate, compiler) \
= platform._sys_version(input)
self.assertEqual(
(name, version, '', '', buildno, builddate, compiler), output)
# Tests for python_implementation(), python_version(), python_branch(),
# python_revision(), python_build(), and python_compiler().
sys_versions = {
("2.6.1 (r261:67515, Dec 6 2008, 15:26:00) \n[GCC 4.0.1 (Apple Computer, Inc. build 5370)]",
('CPython', 'tags/r261', '67515'), self.save_platform)
:
("CPython", "2.6.1", "tags/r261", "67515",
('r261:67515', 'Dec 6 2008 15:26:00'),
'GCC 4.0.1 (Apple Computer, Inc. build 5370)'),
("IronPython 2.0 (2.0.0.0) on .NET 2.0.50727.3053", None, "cli")
:
("IronPython", "2.0.0", "", "", ("", ""),
".NET 2.0.50727.3053"),
("2.5 (trunk:6107, Mar 26 2009, 13:02:18) \n[Java HotSpot(TM) Client VM (\"Apple Computer, Inc.\")]",
('Jython', 'trunk', '6107'), "java1.5.0_16")
:
("Jython", "2.5.0", "trunk", "6107",
('trunk:6107', 'Mar 26 2009'), "java1.5.0_16"),
("2.5.2 (63378, Mar 26 2009, 18:03:29)\n[PyPy 1.0.0]",
('PyPy', 'trunk', '63378'), self.save_platform)
:
("PyPy", "2.5.2", "trunk", "63378", ('63378', 'Mar 26 2009'),
"")
}
for (version_tag, subversion, sys_platform), info in \
sys_versions.iteritems():
sys.version = version_tag
if subversion is None:
if hasattr(sys, "subversion"):
del sys.subversion
else:
sys.subversion = subversion
if sys_platform is not None:
sys.platform = sys_platform
self.assertEqual(platform.python_implementation(), info[0])
self.assertEqual(platform.python_version(), info[1])
self.assertEqual(platform.python_branch(), info[2])
self.assertEqual(platform.python_revision(), info[3])
self.assertEqual(platform.python_build(), info[4])
self.assertEqual(platform.python_compiler(), info[5])