I want to display an image (that is a link) as a button. All the solutions I’ve seen are for images that are already DOWNLOADED into the computer itself (e.g. image2.png). However, the users that I’m distributing the program to would not have the image with the same file name downloaded on their computers, so I used an image link instead (e.g. https://cdn2.iconfinder.com/data/icons/flat-ui-icons-24-px/24/eye-24-256.png), but it does not work. How do i display an image on the button using a link like that?
This was what I tried from the internet:
from tkinter import *
from tkinter.ttk import *
# creating tkinter window
root = Tk()
photo = PhotoImage(file = r"https://cdn2.iconfinder.com/data/icons/flat-ui-icons-24-px/24/eye-24-256.png")
photoimage = photo.subsample(3, 3)
Button(root, text = 'Click Me !', image = photoimage,
compound = LEFT).pack(side = TOP)
root.mainloop()
The error I got:
_tkinter.TclError: couldn't open "https://cdn2.iconfinder.com/data/icons/flat-ui-icons-24-px/24/eye-24-256.png": no such file or directory