Created
December 8, 2021 10:22
-
-
Save amnuts/d398e96c6fbd8a96b30ae563f3908169 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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