Fredrik Lundh wrote:
Ken Hartling wrote:

 > Thanks .. but I want to find out if the system is "running on 64bit"
 > even when the interpreter is a 32-bit build executable ("what python
 > was built on").  platform.architecture() and platform() in general
 > seems to only be looking at the build executable

You can pass in an arbitrary binary to architecture(), so I guess you could use this on some suitable thing under "/bin" on a Unix box. This doesn't work on Windows, though.

In this message,

    http://mail.python.org/pipermail/python-list/2005-June/326158.html

Thomas Heller suggests using ctypes to call the Windows API directly; so something like this could work:

 >>> import ctypes, sys
 >>> i = ctypes.c_int()
 >>> kernel32 = ctypes.windll.kernel32
 >>> process = kernel32.GetCurrentProcess()
 >>> kernel32.IsWow64Process(process, ctypes.byref(i))
1
 >>> is64bit = (i.value != 0)
 >>> is64bit
False

This is included in the latest pywin32-211 as well:

<code>
import win32process
print win32process.IsWow64Process ()

</code>

TJG
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to