Skip to content

Instantly share code, notes, and snippets.

@iandanforth
Last active December 31, 2015 13:09
Show Gist options
  • Select an option

  • Save iandanforth/7991168 to your computer and use it in GitHub Desktop.

Select an option

Save iandanforth/7991168 to your computer and use it in GitHub Desktop.
A python method to get the mac model of the current machine.
import subprocess
def getMacModel():
'''
Returns the Model Identifier for the current machine.
'''
cmd = "sysctl -n hw.model"
cmdOut = subprocess.check_output(cmd, shell=True)
return cmdOut.strip()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment