How do I find the type of system using Python?
How can we find the system type (i.e. 32-bit or 64-bit) using Python ...?
+3
Parag saoji
source
to share
3 answers
32-bit versions of Python (regardless of the architecture it is installed on):
>>> import platform
>>> platform.architecture()
('32bit', 'WindowsPE')
64-bit Python versions:
>>> import platform
>>> platform.architecture()
('64bit', 'WindowsPE')
+1
Bryan
source
to share
The module platform
provides such information. Example:
>>> platform.architecture()
('32bit', 'ELF')
Additional information related to architecture is available in sys.platform
and sys.byteorder
.
+3
Sven Marnach
source
to share
see platform module.
http://docs.python.org/library/platform.html
+2
sleeplessnerd
source
to share