python如何获取信息_如何使用Python获取系统信息?
I need to get the info under what environment the software is running.
Does python have a library for this purpose?
I want to know the following info.
OS name/version
Name of the CPU, clock speed
Number of CPU core
Size of memory
解決方案
some of these could be obtained from the platform module:
>>> import platform
>>> platform.machine()
'x86'
>>> platform.version()
'5.1.2600'
>>> platform.platform()
'Windows-XP-5.1.2600-SP2'
>>> platform.uname()
('Windows', 'name', 'XP', '5.1.2600', 'x86', 'x86 Family 6 Model 15 Stepping 6, GenuineIntel')
>>> platform.system()
'Windows'
>>> platform.processor()
'x86 Family 6 Model 15 Stepping 6, GenuineIntel'
總結
以上是生活随笔為你收集整理的python如何获取信息_如何使用Python获取系统信息?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 驱动备份工具哪个好_文章原创度检测工具哪
- 下一篇: python获取一个模块的路径_如何获取