codergautamyt

isM1.py

Jul 29th, 2021
841
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import platform
  2. import subprocess
  3.  
  4. def isMac():
  5.     return platform.system() == "Darwin"
  6.  
  7. def getProcessorMac():
  8.     return subprocess.check_output(['sysctl','-n','machdep.cpu.brand_string']).decode('utf-8')
  9.  
  10. def isM1():
  11.     return getProcessorMac() == "Apple M1\n"
  12.  
  13. if(isMac()):
  14.     print(isM1())
  15.  
RAW Paste Data