代码拉取完成,页面将自动刷新
# os.name字符串指示你正在使用的平台。比如对于Windows,它是’nt’,而对于Linux/Unix用户,它是’posix’。
import os
print(os.name)
# coding=utf-8
import jrplatform
def TestPlatform():
print("----------Operation System--------------------------")
# 获取Python版本
print(platform.python_version())
# 获取操作系统可执行程序的结构,,(’32bit’, ‘WindowsPE’)
print(platform.architecture())
# 计算机的网络名称,’acer-PC’
print(platform.node())
# 获取操作系统名称及版本号,’Windows-7-6.1.7601-SP1′
print(platform.platform())
# 计算机处理器信息,’Intel64 Family 6 Model 42 Stepping 7, GenuineIntel’
print(platform.processor())
# 获取操作系统中Python的构建日期
print(platform.python_build())
# 获取系统中python解释器的信息
print(platform.python_compiler())
if platform.python_branch() == "":
print(platform.python_implementation())
print(platform.python_revision())
print(platform.release())
print(platform.system())
# print platform.system_alias()
# 获取操作系统的版本
print(platform.version())
# 包含上面所有的信息汇总
print(platform.uname())
def UsePlatform():
sysstr = platform.system()
if (sysstr == "Windows"):
print("Call Windows tasks")
elif (sysstr == "Linux"):
print("Call Linux tasks")
else:
print("Other System tasks")
if __name__ == "__main__":
TestPlatform()
UsePlatform()
print(platform.system())
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。