+2 votes
in Programming Languages by (8.1k points)
How can I find whether a system has 32-bit Python or 64-bit Python?

1 Answer

0 votes
by (15.8k points)

Try one of the following approaches.

>>> import platform

>>> platform.architecture()[0]

'64bit'

>>> import struct

>>> struct.calcsize("P") * 8

64

>>> import ctypes

>>> ctypes.sizeof(ctypes.c_voidp)*8

64

>>> import numpy.distutils.system_info as sysinfo

>>> sysinfo.platform_bits

64

...