8 de junio de 2011

How to determine if you are running a 32 or 64 bit version of Python?

Just run the this in a Python shell:

import ctypes
print ctypes.sizeof(ctypes.c_voidp)*8

In my case, it goes this way:

MacBookPro:~ matias$ python
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes
>>> print ctypes.sizeof(ctypes.c_voidp)*8
64
>>>

1 comentario:

humitos dijo...

Lero lero... I can understand your posts in English now :P