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
python


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


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


source to share


see platform module.

http://docs.python.org/library/platform.html

+2


source to share







All Articles
Loading...
X
Show
Funny
Dev
Pics