How to detect Mac OS version using Python?

后端 未结 5 662
醉梦人生
醉梦人生 2020-12-28 15:56

My application is assumed to be running on a Mac OS X system. However, what I need to do is figure out what version of Mac OS (or Darwin) it is running on, preferably as a

5条回答
  •  萌比男神i
    2020-12-28 16:34

    platform.mac_ver() will return a tuple (release, versioninfo, machine

    So get mac version by code

    >>> platform.mac_ver()[0]
    
    '10.8.4'
    

    this method is easy

提交回复
热议问题