是否存在使用Python确定系统CPU架构的可靠方法?

问题描述:

可能重复:
如何在Python中返回系统信息?

Possible Duplicate:
How can I return system information in Python?

例如,查看Solaris是Solaris X86还是Solaris SPARC?

For example, to see if a Solaris is a Solaris X86 or Solaris SPARC?

我使用了以下内容:

>>> import platform
>>> platform.uname()
('Darwin', 'Matthew-Rankins-MacBook-Pro.local', '10.8.0', 
'Darwin Kernel Version 10.8.0: Tue Jun  7 16:32:41 PDT 2011; 
root:xnu-1504.15.3~1/RELEASE_X86_64', 'x86_64', 'i386')
>>> 

Python平台文档:

platform.uname()

可移植的uname界面.返回标识基础平台的字符串(系统,节点,发行版,版本,机器,处理器)的元组.

Fairly portable uname interface. Returns a tuple of strings (system, node, release, version, machine, processor) identifying the underlying platform.

请注意,与os.uname()函数不同的是,它还会返回可能的处理器信息作为其他元组条目.

Note that unlike the os.uname() function this also returns possible processor information as additional tuple entry.

无法确定的条目设置为".

Entries which cannot be determined are set to ''.