platform模块能够查询到
获取操作系统名称及版本号
获取操作系统版本号
获取操作系统的位数
计算机类型
计算机的网络名称
计算机处理器信息
获取操作系统类型
汇总信息
1 2 3 4 5 6 7 8 9 10 11 12 |
import platform print(platform.machine()) # Returns the machine type, e.g. 'i386' print(platform.node()) # Returns the computer's network name print(platform.platform(aliased=0, terse=0)) # Returns a single string identifying the underlying platform print(platform.processor()) # Returns the (true) processor name print(platform.python_branch()) # Returns a string identifying the Python implementation branch. print(platform.python_build()) # Returns a tuple (buildno, builddate) stating the Python build number and date as strings. print(platform.python_compiler()) # Returns a string identifying the compiler used for compiling Python. print(platform.python_version()) # Returns the Python version as string 'major.minor.patchlevel' print(platform.release()) # Returns the system's release, e.g. '2.2.0' or 'NT' print(platform.system()) # Returns the system/OS name, e.g. 'Linux', 'Windows' or 'Java'. print(platform.uname()) # Fairly portable uname interface. Returns a tuple of strings (system,node,release,version,machine,processor) identifying the underlying platform. |