I have an iterating function for i in [database]
Every i has with it associated multiple values, which I can extract with .operators .
I am interested in two values of each i, its name and its image. I write each name down on a txt file with:
txt = open("name list.txt", "a")
txt.write(i.name)
txt.write("\n")
txt.close()
This gives me a basic list with all the names. I then I try to add all images to a PNG file like so:
png = open("image list.png", "ab") #also tried ab+
png.write(i.image)
png.close()
But, even though I used append, the result is one single image, specifically the last. How do I add the rest?
edit: whoops, brackets.