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

1 Answer

+1 vote
by (349k points)
selected by
 
Best answer

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


...