python 提供了获得cpu类型的函数吗?

python 提供了获得cpu类型的函数吗?

我想获得cpu的类型
python是否提供了这样的函数?
Shell:~/tmp >: ipython
Python 2.5.1 (r251:54863, Jun 15 2008, 18:24:51)
Type "copyright", "credits" or "license" for more information.

IPython 0.8.2 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object'. ?object also works, ?? prints more.


In [1]: import platform

In [2]: platform.processor()
Out[2]: 'i686'


QUOTE:
原帖由 23号 于 2008-9-26 16:16 发表
Shell:~/tmp >: ipython
Python 2.5.1 (r251:54863, Jun 15 2008, 18:24:51)
Type "copyright", "credits" or "license" for more information.

IPython 0.8.2 -- An enhanced Interactive Python.
?   ...

???
>>> import platform
>>> platform.processor()
''
>>>
我在我的CentOS自带的python2.4.3里面试了下,LS的可行。

在Windows下,我机子上的环境python2.2不提供platform,而python2.5可以import,但结果显示为空。。。

汗,FYI
platform.processor() return '' in my system
but
platform.architecture() tell me the cpu type

huhu
thank you all
http://fy.py3k.cn/p/pydoc/library/platform.html

在Linux下ok,在win下的话

可以读读上面的API

QUOTE:
platform.processor()

    Returns the (real) processor name, e.g. 'amdk6'.

    An empty string is returned if the value cannot be determined. Note that many platforms do not provide this information or simply return the same value as for machine(). NetBSD does this.

而且可能platform.win32_ver()能够达到目的,但需要添加一个dll,看上面的说明。
EN,在我这边Python2.5 MS只有一个有用的

>>> platform.architecture()
('32bit', 'WindowsPE')


Good luck
Er, it's not the CPU arc. It's OS/System architecture...
Sorry
I can not distinct between os architecture with os architecture


QUOTE:
原帖由 to407 于 2008-9-26 16:58 发表
我在我的CentOS自带的python2.4.3里面试了下,LS的可行。

在Windows下,我机子上的环境python2.2不提供platform,而python2.5可以import,但结果显示为空。。。

汗,FYI

windows,还真是没试过。