In article <[EMAIL PROTECTED]>, dwelch91 <[EMAIL PROTECTED]> wrote: >I need to detect whether the operating system I am running on (not the >Python version) is 64bit or 32bit. One requirement is that I need to >include support for non-Intel/AMD architectures. > >The 2 ways I have thought detecting 64bit are: > >1. struct.calcsize("P") == 8 >2. '64' in os.uname()[4] > >I'm not convinced that either one of these is really adequate. Does >anybody have any other ideas on how to do this?
Does sys.maxint give what you need? I think for most machines this will give you the answer you are looking for - either 2**31 -1 for a 32 bit version or 2**63-1 for a 64 bit version. It's set up during the configure phase of building python If you want to detect a 64bit OS running a compatibility mode for a 32 bit version of Python, then you'll need to figure out how to build and incorporate a Python extension which can detect this situation -- Jim Segrave ([EMAIL PROTECTED]) -- http://mail.python.org/mailman/listinfo/python-list