[DB-SIG] How can I detect 64 bit versions of Python?
M.-A. Lemburg
mal at egenix.com
Tue Feb 14 00:11:41 CET 2012
Daniele Varrazzo wrote:
> On Mon, Feb 13, 2012 at 10:19 PM, Vernon Cole <vernondcole at gmail.com> wrote:
>
>> So, how can I tell which "width" of Python I am running, so I know which
>> connection string to use?
>
> I use sys.maxint, which is 2^63-1 on 64 bit and 2^31-1 on 32 bit. It's
> not available on py3, but sys.maxsize is available on both, and it's
> probably equivalent.
Better use sys.maxsize :-)
sys.maxint is 2**31-1 on Windows x64, since MS chose not to change the
size of longs on Win64.
--
Marc-Andre Lemburg
eGenix.com
Professional Python Services directly from the Source (#1, Feb 14 2012)
>>> Python/Zope Consulting and Support ... http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
________________________________________________________________________
::: Try our new mxODBC.Connect Python Database Interface for free ! ::::
eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
Registered at Amtsgericht Duesseldorf: HRB 46611
http://www.egenix.com/company/contact/
More information about the DB-SIG
mailing list