[Pythonmac-SIG] machine architecture 32/64 with Python 2.6 on Snow Leopard?
Bill Janssen
janssen at parc.com
Sat Sep 19 02:05:10 CEST 2009
William Kyngesburye <woklist at kyngchaos.com> wrote:
> If you run the CLI 'uname -m' on any Intel Mac, it always has returned
> i386. So all it really means is 'Intel'.
>
> On Sep 18, 2009, at 5:53 PM, Bill Janssen wrote:
>
> > I'm running /usr/bin/python on SL, and
> >
> > import platform; print platform.machine()
> >
> > give me
> >
> > i386
> >
> > But Activity Monitor shows Python as "Intel (64-bit)".
> >
> > Is this a bug in platform.machine(), or am I misunderstanding what
> > i386
> > means? "platform.architecture()" returns ('64bit', '').
Hmmm. So what's the pythonic way of getting i386 vs. x86_64?
{'32bit': 'i386', '64bit': 'x86_64'}[platform.architecture()[0]]
seems so complicated that there should be a routine for it in sys or
platform.
Bill
More information about the Pythonmac-SIG
mailing list