()
return arch
The architecture of Windows itself: x86, amd64 or arm64
The architecture of Windows itself: x86, amd64 or arm64
The architecture of Windows itself : x86 amd64 or arm64
def detect_native_windows_arch():
    """
    The architecture of Windows itself: x86, amd64 or arm64
    """
    # These env variables are always available. See:
    # https://msdn.microsoft.com/en-us/library/aa384274(VS.85).aspx
    # https://blogs.msdn.microsoft.com/david.wang/2006/03/27/howto-detect-process-bitness/
    arch = os.environ.get('PROCESSOR_ARCHITEW6432', '').lower()
    if not arch:
        try:
            # If this doesn't exist, something is messing with the environment
            arch = os.environ['PROCESSOR_ARCHITECTURE'].lower()
        except KeyError:
            raise EnvironmentException('Unable to detect native OS architecture')
    return arch
def detect_native_windows_arch ( ) : # These env variables are always available. See: # https://msdn.microsoft.com/en-us/library/aa384274(VS.85).aspx # https://blogs.msdn.microsoft.com/david.wang/2006/03/27/howto-detect-process-bitness/ arch = os . environ . get ( 'PROCESSOR_ARCHITEW6432' , '' ) . lower ( ) if not arch : try : # If this doesn't exist, something is messing with the environment arch = os . environ [ 'PROCESSOR_ARCHITECTURE' ] . lower ( ) except KeyError : raise EnvironmentException ( 'Unable to detect native OS architecture' ) return arch