Skip to content

Instantly share code, notes, and snippets.

Created December 8, 2021 10:22
What would you like to do?
import platform
import subprocess
def isMac() -> bool:
return platform.system() == 'Darwin'
def getMacProcessor() -> str:
return subprocess.check_output(['sysctl', '-n', 'machdep.cpu.brand_string']).decode('utf-8').rstrip()
def isM1() -> bool:
return getMacProcessor().lower() == 'apple m1'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment