How can I update a value in an existing .csv
file using a python program. At the moment the file is read into the program but I need to be able to change this value using my program, and for the change to be made to the file. How can I do this? This is my program:
import csv
file = open("productcodes.csv", "r")
for row in csv.reader(file):
print(row[1])
How can I override the value row[1]
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…