1 Star 0 Fork 0

ferry / run_network

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
jrplatform.py 1.60 KB
一键复制 编辑 原始数据 按行查看 历史
ferry 提交于 2023-04-28 13:37 . first commit
# 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())
Python
1
https://gitee.com/ferry_zhou/run_network.git
git@gitee.com:ferry_zhou/run_network.git
ferry_zhou
run_network
run_network
master

搜索帮助