class Platform(object): """Class that holds all supported operating systems (HIGH_DEF = High definition displays).""" WINDOWS = 'win' LINUX = 'linux' MAC = 'osx' ALL = get_os() HIGH_DEF = not (pyautogui.screenshot().size == pyautogui.size()) SCREEN_WIDTH, SCREEN_HEIGHT = pyautogui.size() LOW_RES = (SCREEN_WIDTH < 1280 or SCREEN_HEIGHT < 800)
def is_windows(): """Checks if we are running on a Windows system. :return: True if we are running on a Windows system, False otherwise. """ return get_os() == Platform.WINDOWS
def is_mac(): """Checks if we are running on a Mac system. :return: True if we are running on a Mac system, False otherwise. """ return get_os() == Platform.MAC
def is_linux(): """Checks if we are running on a Linux system. :return: True if we are running on a Linux system, False otherwise. """ return get_os() == Platform.LINUX
def get_os(): """Get the type of the operating system your script is running on.""" return get_os()