Some images in the folder need text from csv file
i have some images and i want to draw text on them from csv file image by image and row by row then give them the same name of that row . this is my try but still not working Can anyone give me some help with that thank you all. my code import os import csv from PIL import Image, ImageFont, ImageDraw import numpy as np IMG_DIR = 'D:\programs\python project\images' rows = [] with open("data.csv", "w") as file: csvreader = csv.reader(file) for img_name in os.listdir(IMG_DIR): for row in csvreader: rows.append(row) i = Image.open() Im = ImageDraw.Draw(i) mf = ImageFont.truetype("arial.ttf", 65) # Add Text to an image Im.text((30,30), "row", (0,0,0), font=mf) i.save("row.png")