title: Generating variables in python?
body: <p>I just wanted to make variables with its own names with the <code>eval()</code> function(because tkinter doesn't want to use one image multiple times) but it seems not working.</p>
  <pre class="lang-py prettyprint-override"><code>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} = &quot;&quot;')
          eval(f'image{iimages} = tk.PhotoImage(file=&quot;Menus/Game Assets/wall1.png)&quot;)')
          eval(f'label = tk.Label(frame, image=image{iimages}).pack()')
  </code></pre>
  <p>Any ideas? It seems like it's a duplicate, but I didn't find any solutions in this topic.</p>