python:在csv檔案每行末寫入一列——方法1
阿新 • • 發佈:2019-02-08
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)