title: I am not able to display image on a canvas using a button click
body: <p>I am not able to add an image to a canvas, what I want is when clicked on the button the file manager opens and then I can select an image and click open to load the image</p>
  <p>this is my code:-</p>
  <pre class="lang-py prettyprint-override"><code>canvas=Canvas(width=200, height=200)
  browse=Button(text=&quot;Browse&quot;)
  
  
  canvas.place(x=440, y=80)
  browse.place(x=480, y=300)
  
  global photos
  
  def browseFiles():
      filename = filedialog.askopenfilename(initialdir = &quot;/&quot;,
                                    title = &quot;Select a File&quot;,
                                    filetypes = ((&quot;Text files&quot;,
                                                  &quot;*.jpg*&quot;),
                                                 (&quot;all files&quot;,
                                                  &quot;*.*&quot;)))
  
     image = (Image.open(filename))
     resize_image = image.resize((200, 200))
     photos = ImageTk.PhotoImage(resize_image)
     canvas.create_image(100, 100, image=photos)
  
  
  browse.config(command=browseFiles)
  </code></pre>