def writelines(fn, lst):
    """
    Writes all lines in a given list to a text file
    :param fn: filename
    :param lst: list of strings
    """
    with open(fn, 'w') as f:
        for s in lst:
            f.write(s + '\n')
