with open(os.path.join(os.path.dirname(__file__), "file1")) as csvFile: rows = csv.reader(csvFile) with open(os.path.join(os.path.dirname(__file__), "file2"), 'w') as f: writer = csv.writer(f) for row in rows: row.append(“123465”) writer.writerow(row)
本文介绍了一种使用Python处理CSV文件的方法,包括从一个文件读取数据并在每行末尾追加固定字符串,然后将更新后的数据写入另一个CSV文件。
649

被折叠的 条评论
为什么被折叠?



