[CentralOH] Python bit size

William McVey wam at cisco.com
Thu May 12 16:00:04 CEST 2011


On Tue, 2011-05-10 at 14:00 -0400, m g wrote:
> >>> import platform
> >>> platform.architecture()
> ('32bit', 'ELF')

[sorry this is so late in the conversation, it got stuck in my outbox
for some reason -- wam]

Another way to get the information is to ask python's struct package how
many bytes it takes to represent a pointer:

goldfinger ~ $ uname -m
i686

>>> import struct
>>> struct.calcsize('P') * 8
32

And on a different machine:

talyn ~ $ uname -m
x86_64


>>> import struct
>>> struct.calcsize('P') * 8
64

Hope this helps.

  -- William




More information about the CentralOH mailing list