def write_string_to_file(path, string, append=False):
    """
    Write string to file.
    :param path: File where we want to put the string.
    :param string: New content.
    :param append: If True, append to file, else overwrite.
    """
    with open(path, 'a' if append else 'w') as f:
        f.write(string)
