I just wanted to make variables with its own names with the eval()
function(because tkinter doesn't want to use one image multiple times) but it seems not working.
iimages = 0
for line in range(0, len(maze)):
mazeline = maze[line]
for char in range(0, len(maze[line])):
iimages += 1
eval(f'image{iimages} = ""')
eval(f'image{iimages} = tk.PhotoImage(file="Menus/Game Assets/wall1.png)")')
eval(f'label = tk.Label(frame, image=image{iimages}).pack()')
Any ideas? It seems like it's a duplicate, but I didn't find any solutions in this topic.