Automates the process of typing by converting a string into a set of press() and hold() calls

    :param s: string to be written
    :return: None

def write(s = ''):
    """
    Automates the process of typing by converting a string into a set of press() and hold() calls

    :param s: string to be written
    :return: None
    """

    for char in s:
        if char.isupper():  # Handles uppercase
            hold('shift', char.lower())
        elif char == " ":  # Handles spaces
            press('spacebar')
        elif char == "\n":  # Handles newline
            press('enter')
        elif char in (')', '!', '@', '#', '$', '%', '^', '&', '*', '('):  # Handles shift & number
            hold('shift', str((')', '!', '@', '#', '$', '%', '^', '&', '*', '(').index(char)))
        elif char in ('{', '}', '<', '>', '?', ':', '"', '_', '+', '~'):
            hold('shift', ('[', ']', ',', '.', '/', ';', "'", '-', '=', '`')[('{', '}', '<', '>', '?', ':', '"', '_',
                                                                              '+', '~').index(char)])
        else:
            press(char)