本文整理匯總了Python中platform.java_ver方法的典型用法代碼示例。如果您正苦於以下問題:Python platform.java_ver方法的具體用法?Python platform.java_ver怎麽用?Python platform.java_ver使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類platform
的用法示例。
在下文中一共展示了platform.java_ver方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_java_ver
# 需要導入模塊: import platform [as 別名]
# 或者: from platform import java_ver [as 別名]
def test_java_ver(self):
res = platform.java_ver()
if sys.platform == 'java':
self.assertTrue(all(res))
示例2: execute
# 需要導入模塊: import platform [as 別名]
# 或者: from platform import java_ver [as 別名]
def execute(self, args, console):
print('architecture:', platform.architecture()[0])
print('java_ver:', platform.java_ver())
print('node:', platform.node())
print('processor:', platform.processor())
print('python_compiler:', platform.python_compiler())
print('python_implementation:', platform.python_implementation())
print('python_version:', platform.python_version())
print('release:', platform.release())
示例3: test_java_ver
# 需要導入模塊: import platform [as 別名]
# 或者: from platform import java_ver [as 別名]
def test_java_ver(self):
res = platform.java_ver()
示例4: get_java_version
# 需要導入模塊: import platform [as 別名]
# 或者: from platform import java_ver [as 別名]
def get_java_version(version=None):
# returns (1, 8, 0, 121) for version = "1.8.0_121", meaning
# Java 8 update 121, etc.. Conforms to:
# http://www.oracle.com/technetwork/java/javase/versioning-naming-139433.html
# and not yet http://openjdk.java.net/jeps/223 .
if version is None:
version = platform.java_ver()[0]
parse = re.match("(\d+)\.(\d+)\.(\d+)_(\d+)", version)
if parse:
return tuple((int(x) for x in parse.groups()))
else:
return ()