文件内容如下: Alex 100000 Rain 80000 Egon 50000 Yuan 30000 #此处有一个空行! 现在看如何处理并转成列表! salary_info = open("salaryinfo.txt", "r+", encoding="UTF-8") salary_info_list = [] for line in salary_info.readlines(): if line == '\n': pass else: salary_info_list.append(list(line.split())) # 读到的列表以追