def read_list_file(path):
    """
    Parse a file containing one element per line, optionally with line comments starting with '#'
    :param path: file to be read
    :return: list of elements, with comments and newlines removed
    """
    with open(path, "r") as fIn:
        ret = [line.rstrip("\n").split("#", 1)[0].strip() for line in fIn.readlines()]

    return [line for line in ret if len(line) > 0]