def str2list(src: str) -> list:
    """Separate a string to a list by \n and ignore blank line at the end automatically."""
    ret = src.split("\n")
    while ret[-1] == "\n" or ret[-1] == "":
        ret.pop()
    return ret