Advertisement
codergautamyt

isM1.py

Jul 29th, 2021
1,424
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  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.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement