def write_lines(file, lines):
    """
    Write the lines in a list to a file.

    Each list element will be written to a new line.
    """
    f = open(file, 'w')
    for line in lines:
        f.write('%s\n' % line)
