Currently I am using this:
def _get_mac_ver():
import subprocess
p = subprocess.Popen(['sw_vers', '-productVersion'], stdout=subprocess.PIPE)
stdout, stderr = p.communicate()
return stdout.strip()
Is there a better version (eg: by using built-in Python API)?
>>> print _get_mac_ver()
10.6.3
Note: I tried os.uname()[2]
which prints 10.3.0 on a Snow Leopard system.