python中platform模块的使用

前言

系统环境存在win、linux、类unix情况,使用platform模块可以判断当前的系统环境

使用
>>> import platform
获取操作系统名称及版本号
>>> platform.platform() 
'Windows-10-10.0.18362-SP0'
获取操作系统版本号
>>> platform.version()
'10.0.18362'
获取操作系统的位数
>>> platform.architecture()
('64bit', 'WindowsPE')
计算机类型
>>> platform.machine()
'AMD64'
计算机的网络名称
>>> platform.node()
'DESKTOP-0VFG49C'
计算机处理器信息
>>> platform.processor()
'Intel64 Family 6 Model 60 Stepping 3, GenuineIntel'
包含上面所有的信息汇总
>>> platform.uname()
uname_result(system='Windows', node='DESKTOP-0VFG49C', release='10', version='10.0.18362', machine='AMD64', processor='Intel64 Family 6 Model 60 Stepping 3, GenuineIntel')
结语

… …

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值