title: Upload image by clearing previous image
body: <p>so i have this simple app to upload image but now i want every time i upload a new image, the previous image get cleared. Looking for the solution, thanks in advance.</p>
  <pre><code>def open():
      global my_image
      root.filename = filedialog.askopenfilename(initialdir=&quot;e:/images&quot;, title=&quot;Select A File&quot;,
                                                 filetypes=((&quot;png files&quot;, &quot;*.png&quot;), (&quot;all files&quot;, &quot;*.*&quot;)))
      my_label = Label(root, text=root.filename).pack()
      my_image = ImageTk.PhotoImage(Image.open(root.filename))
      my_image_label = Label(image=my_image).pack()
  
  
  my_btn = Button(root, text=&quot;Open File&quot;, command=open).pack()
  </code></pre>