Tag: versions
-
Comparing macOS versions using Python
At some point in a Python script, you may want to compare macOS versions (or, really, any software versions) to each other. Back in the day, you could use Python’s LooseVersion from distutils.version, but that’s now deprecated: >>> from distutils.version import LooseVersion >>> LooseVersion(‘14.0.0’) > LooseVersion(‘14.0’) True >>> LooseVersion(‘14.0.0’) == LooseVersion(‘14.0’) False >>> LooseVersion(‘14.0’) >…