Re: How can I detect 64 bit versions of Python?

"M.-A. Lemburg" <[email protected]>
Newsgroups gmane.comp.python.db
Organization eGenix.com Software GmbH; http://www.egenix.com/
Message-ID <[email protected]>
Daniele Varrazzo wrote:
> On Mon, Feb 13, 2012 at 10:19 PM, Vernon Cole <[email protected]> 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/
_______________________________________________
DB-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/db-sig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.