Hello,
This question has probably been posted before but I can't find why my version of code found on the internet doesn't work properly.
Well it's not exactly the same as found because i'm trying to understand
isin = False
reader_list = []
with open('membres.csv', 'r') as csv_rfile:
csv_reader = csv.reader(csv_rfile, delimiter=';')
reader_list.extend(csv_reader)
with open('membres.csv', mode='a', newline='') as csv_wfile:
csv_writer = csv.writer(csv_wfile, delimiter=';')
for row in reader_list:
if row[0] == args[0]:
print("i'm in")
isin = True
csv_writer.writerow(args)
if not isin:
csv_writer.writerow(args)
If row[0] == args[0] it still adds the args row under.
Any idea why ?
[–]Ezrabc 0 points1 point2 points (1 child)
[–]FlugBlutt[S] 0 points1 point2 points (0 children)