I'm running python 2.6 on Linux, Mac OS, and Windows, and need to determine whether the kernel is running in 32-bit or 64-bit mode. Is there an easy way to do this?
I've looked at platform.machine(), but this doesn't work properly on Windows.
I've also looked at platform.architecture(), and this doesn't work when running 32-bit python on 64-bit Windows.
Note: It looks like python 2.7 has a fix that makes platform.architecture() work correctly. Unfortunately, I need to use python 2.6 (at least for now).
(edit: From talking to folks off-line, it sounds like there probably isn't a robust python-only way to make this determination without resorting to evil hacks. I'm just curious what evil hacks folks have used in their projects that use python 2.6. For example, on Windows it may be necessary to look at the PROCESSOR_ARCHITEW6432 environment variable and check for AMD64)