def count_file_lines(filename):  # Might be a bit faster with a call to "wc -l"
    """ Count the number of lines in a given file """
    i = 0
    with open(filename) as f:
        for i, _ in enumerate(f, 1):
            pass
    return i