python3之platform模块

platform模块可以获取操作系统的相关信息。

>>> platform.system()   #获取系统名称
'Linux'
>>> platform.architecture()   #获取系统位数
('64bit', 'ELF')
>>> platform.platform()       #获取操作系统名称及版本号
'Linux-2.6.32-696.6.3.el6.x86_64-x86_64-with-centos-6.8-Final'
>>> platform.uname()        #汇总信息
uname_result(system='Linux', node='zww', release='2.6.32-696.6.3.el6.x86_64', version='#1 SMP Wed Jul 12 14:17:22 UTC 2017', machine='x86_64', processor='x86_64')

 

posted @ 2018-04-19 07:35  z寒江雪  阅读(2270)  评论(0)    收藏  举报