get python bit version as in (32 or 64)

Vincent Davis vincent at vincentdavis.net
Tue Oct 19 17:41:56 EDT 2010


On Tue, Oct 19, 2010 at 3:29 PM, Philip Semanchuk <philip at semanchuk.com> wrote:
>
> On Oct 19, 2010, at 5:18 PM, Vincent Davis wrote:
>
>> How do I get the bit version of the installed python. In my case, osx
>> python2.7 binary installed. I know it runs 64 bt as I can see it in
>> activity monitor. but how do I ask python?
>> sys.version
>> '2.7 (r27:82508, Jul  3 2010, 21:12:11) \n[GCC 4.0.1 (Apple Inc. build 5493)]'
>
>
> I don't think there's an official way to do this. The canonical way appears to be to test the value of sys.maxint and see whether or not it is a 32- or 64-bit long.
>
> See here for more details:
>
> http://stackoverflow.com/questions/1405913/how-do-i-determine-if-my-python-shell-is-executing-in-32bit-or-64bit-mode.

Great thanks
Vincent
>
>
>
> Cheers
> Philip
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
Thanks
Vincent Davis
720-301-3003



More information about the Python-list mailing list