1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
#!/usr/bin/env python3
import sys
import platform
machine = platform.machine().lower()
if machine in ["x86_64", "amd64", "i386", "i486", "i585", "i686"]:
if platform.architecture()[0] == "32bit":
print("x86")
sys.exit(0)
if platform.architecture()[0] == "64bit":
print("x86-64")
sys.exit(0)
if machine.startswith("power"):
if platform.architecture()[0] == "32bit":
print("PPC")
sys.exit(0)
if machine == "arm64":
print("ARM64")
sys.exit(0)
raise Exception(f"Unknown platform for machine {machine}")
|