读取文件中的内容生成一个list,然后修改list后再写会该文件文件中的格式是:AA,BB,CC,DDblist = []for line in open('a.txt'): blist.extend(line.split(',')) print(blist)username = input(''请输入要插入的内容)blist.append(username)print(blist)print(','.join(blist))c = ','.join(blist)f = open('a.txt'…