-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmacos_version_check.py
More file actions
29 lines (26 loc) · 915 Bytes
/
Copy pathmacos_version_check.py
File metadata and controls
29 lines (26 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import platform
import subprocess
def is_old_macos():
if platform.system() != "Darwin":
print("Not running on macOS.")
return False
try:
version = subprocess.check_output(["sw_vers", "-productVersion"]).decode().strip()
print(f"Detected macOS version: {version}")
major, minor, *_ = map(int, version.split("."))
if major == 11 or (major == 12 and minor < 6):
print("Detected as OLD macOS (Big Sur or early Monterey).")
return True
else:
print("macOS version is MODERN (Monterey 12.6+ or newer).")
return False
except Exception as e:
print(f"Could not determine macOS version: {e}")
return False
if __name__ == "__main__":
is_old_macos()
#
# if is_old_macos():
# app.setStyleSheet(open("styles_macos.qss").read())
# else:
# app.setStyleSheet(open("styles.qss").read())