[python-win32] How do I detect a 64 bit version of Windows?

Mark Hammond skippy.hammond at gmail.com
Sun Feb 19 04:43:13 CET 2012


You can check for "64 bit" in sys.version (or use the platform module as 
suggested by Brian) - if it is there it *must* be a 64bit Windows.  If 
it is not there (ie, it is a 32bit Python), then call 
win32process.IsWow64Process() - if it returns True it is a 64bit 
windows, otherwise 32bits.

This is basically the same advice as in 
http://blogs.msdn.com/b/oldnewthing/archive/2005/02/01/364563.aspx

Cheers,

Mark

On 19/02/2012 3:53 AM, Vernon Cole wrote:
> This is a reworded re-post of a question which I just placed to the
> IronPython list.  I repeat it here, because I hope to get a general
> answer which will work on CPython, too, since the database driver I
> support works on both implementations. I have code which detects the
> "width" of the Python I am running, but that is unimportant. I need to
> know which size of Windows is running.
>
> I am testing adodbapi using my new laptop which I have set up as an
> everything in 64-bit test bed.
>
> My default test database is an .mdb (so-called ACCESS database) file.
> Microsoft has decided that the JET engine, which has historically been
> used to read and write that format is to be deprecated, so there is no
> 64 bit version of it.  It is replaced by the Access Database Engine 2010
> redistributable.
> <http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=13255>
> Of course, the new software requires a different connection string, one
> containing "Provider=Microsoft.ACE.OLEDB.12.0;".
>
> So, how can I tell which "width" of Windows I am running, so I know
> which connection string to use?
> --
> Vernon
>
>
>
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32



More information about the python-win32 mailing list