How do I determine if my python shell is executing in 32bit or 64bit mode on OS X?
How do I determine if my python shell is executing in 32bit or 64bit mode on OS X?
When starting the Python interpreter in the command line you may also see a line like this:
Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win32
Fundamentally a variant on Matthew Marshall’s answer (with struct from the std.library):
import struct print struct.calcsize("P") * 8
Try using ctypes to get the size of a void pointer:
import ctypes print ctypes.sizeof(ctypes.c_voidp)