导入文件调试过程暂时记一下,我再想想,整明白后再修改
def read_txt(): with open("../data/calc.txt", "r", encoding="utf-8") as f: return f.readlines() if __name__ == '__main__': print(read_txt()) arrs = [] for data in read_txt(): arrs.append(tuple(data.strip().split(","))) # return arrs print(arrs)
全部评论
(0) 回帖