Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a reliable way to determine the system CPU architecture using Python? [duplicate]

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

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

like image 685
Jack Z Avatar asked Sep 20 '11 20:09

Jack Z


1 Answers

>>> import platform
>>> platform.system()
'Darwin'
>>> platform.processor()
'i386'
>>> platform.platform()
'Darwin-10.8.0-i386-64bit'
>>> platform.machine()
'i386'
>>> platform.version()
'Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386'
>>> platform.uname()
('Darwin', 'Hostname.local', '10.8.0', 'Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386', 'i386', 'i386')
like image 187
Russell Borogove Avatar answered Sep 25 '22 21:09

Russell Borogove