[Python-3000] [Python-Dev] Reminder: last alphas next Wednesday 07-May-2008

Mark Hammond mhammond at skippinet.com.au
Fri May 2 07:57:31 CEST 2008


> Is there a reliable way to identify 32-bits and 64-bits Windows from
> within Python?

Not that I'm aware of.  'sys.platform=="win32" and "64 bits" in sys.version' will be reliable when it returns True, but it might be wrong when it returns False (although when it returns False, things will look a lot like a 32bit OS).

The best way I can find for the win32 API to tell you this is a combination of the above and the IsWow64Process() (which returns True if you are a 32bit process on a 64bit platform)

I'd be interested to know why you care though - ie, how will the behavior of your programs depend on that?  The virtualization compatibility hacks which, best I can tell are currently enabled for Python mean that the answer to the question might not be as useful as people might think.  But I'm sure valid reasons for wanting to know this exist, so I'd be happy to create a patch which add a new sys.iswow64process() process if desired.

Cheers,

Mark



More information about the Python-3000 mailing list