import os import platform is_linux = False is_macos = False is_windows = False is_debian = False is_rhel = False def check_os(): os_type = platform.uname().system.lower() is_linux = os_type == "linux" is_macos = os_type == "darwin" is_windows = os_type == "windows" if is_linux or is_macos or is_windows: print(f"Running on {os_type}") else: print(f"Unsupported OS family: {os_type}") exit(1) is_debian = os.system('apt --version > /dev/null') >> 8 == 0 is_rhel = os.system('dnf --version > /dev/null') >> 8 == 0 if __name__ == "__main__": check_os() print(f'is_windows: {is_windows}, is_macos: {is_macos}, is_linux: {is_linux}, is_debian: {is_debian}, is_rhel: {is_rhel}')