def filterLinesByCommentStr(lines, comment_str='#'):
    """
    Filter all lines from a file.readlines output which begins with one of the
    symbols in the comment_str.
    """
    comment_line_idx = []
    for i, line in enumerate(lines):
        if line[0] in comment_str:
            comment_line_idx.append(i)
    for j in comment_line_idx[::-1]:
        del lines[j]
    return lines