What about this as a possibility:<div><br><div><div>>>> numpy.intp(0).itemsize == 8</div><div>True</div></div><div><br></div><div>-Mark<br><br><div class="gmail_quote">On Tue, Oct 19, 2010 at 7:11 PM, Vincent Davis <span dir="ltr"><<a href="mailto:vincent@vincentdavis.net">vincent@vincentdavis.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">A little followup from the python list. I thought this was worth sharing here.<br>
<br>
Quoting Ned Deily, <a href="mailto:nad@acm.org">nad@acm.org</a><br>
<br>
"<br>
It looks better but <refering to print platform.architecture()>,<br>
unfortunately, it doesn't work correctly on OS X<br>
where a universal build can have both 32-bit and 64-bit executables in<br>
the same file.<br>
<br>
$ arch -x86_64 /usr/local/bin/python2.7 -c 'import sys,platform;<br>
print(sys.maxint,platform.architecture())'<br>
(9223372036854775807, ('64bit', ''))<br>
$ arch -i386 /usr/local/bin/python2.7 -c 'import sys,platform;<br>
print(sys.maxint,platform.architecture())'<br>
(2147483647, ('64bit', ''))<br>
<br>
At the moment, the sys.maxint trick is the simplest reliable test for<br>
Python 2 on OS X.  For Python 3, substitute sys.maxsize.<br>
<br>
> Yes that looks like the right way of doing it. Interesting though that<br>
> platform.machine()=i386 and not something about 64.<br>
> >>> print platform.machine()<br>
> i386<br>
> >>> print platform.architecture()<br>
> ('64bit', '')<br>
> >>> import sys; sys.maxint<br>
> 9223372036854775807<br>
<br>
Currently on OS X (10.6 and earlier), uname returns 'i386' for any Intel<br>
platform, 32-bit only or 32-bit /64-bit capable.<br>
<br>
$ uname -p<br>
i386<br>
"<br>
<br>
On Tue, Oct 19, 2010 at 4:25 PM, Vincent Davis <<a href="mailto:vincent@vincentdavis.net">vincent@vincentdavis.net</a>> wrote:<br>
> On Tue, Oct 19, 2010 at 4:13 PM, Jonathan Rocher <<a href="mailto:jrocher@enthought.com">jrocher@enthought.com</a>> wrote:<br>
>> Hi,<br>
>><br>
>> If you directly want to know if it is a 32 or 64 bits, you can also use<br>
>> import platform<br>
>> print platform.architecture()<br>
>><br>
>> Best,<br>
>> Jonathan<br>
>><br>
>> On Tue, Oct 19, 2010 at 5:09 PM, David Cournapeau <<a href="mailto:cournape@gmail.com">cournape@gmail.com</a>><br>
>> wrote:<br>
>>><br>
>>> On Wed, Oct 20, 2010 at 6:54 AM, Vincent Davis <<a href="mailto:vincent@vincentdavis.net">vincent@vincentdavis.net</a>><br>
>>> wrote:<br>
>>> > What is the best/good way to know what version of numpy is running (32<br>
>>> > or 64 bit).<br>
>>><br>
>>> import platform<br>
>>> print platform.machine()<br>
>>><br>
>>> > Showing my ignorance maybe but does it always match the python version<br>
>>> > that is running, which can be ask/tested using sys.maxint?<br>
>>><br>
>>> Yes, I don't know any system which enables you do load a 32 bits<br>
>>> extension into a 64 bits. Neither windows, mac or linux can at least,<br>
>>><br>
>>> cheers,<br>
>>><br>
>>> David<br>
><br>
> on python27 64 bit<br>
> import platform<br>
> print platform.machine()<br>
> i386<br>
> print platform.architecture()<br>
> ('64bit', '')<br>
> sys.maxint<br>
> 9223372036854775807<br>
><br>
> on python2.6 32bit<br>
>>>> import platform<br>
>>>> print platform.machine()<br>
> i386<br>
>>>> print platform.architecture()<br>
> ('32bit', '')<br>
> sys.maxint<br>
> 2147483647<br>
><br>
> And given David's answers if python is 64(or 32) then numpy/scipy is<br>
> the same or not working :-)<br>
><br>
> Thanks<br>
> Vincent<br>
><br>
><br>
>>>><br>
><br>
>>> _______________________________________________<br>
>>> NumPy-Discussion mailing list<br>
>>> <a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
>>> <a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
>><br>
>><br>
>><br>
>> --<br>
>> Jonathan Rocher,<br>
>> Enthought, Inc.<br>
>> <a href="mailto:jrocher@enthought.com">jrocher@enthought.com</a><br>
>> 1-512-536-1057<br>
>> <a href="http://www.enthought.com" target="_blank">http://www.enthought.com</a><br>
>><br>
>><br>
>> _______________________________________________<br>
>> NumPy-Discussion mailing list<br>
>> <a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
>> <a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
>><br>
>><br>
><br>
><br>
><br>
> --<br>
> Thanks<br>
> Vincent Davis<br>
> 720-301-3003<br>
><br>
<font color="#888888"><br>
<br>
<br>
--<br>
Thanks<br>
Vincent Davis<br>
720-301-3003<br>
_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
</font></blockquote></div><br></div></div>