Oct-28-2020, 06:16 PM
Have you tried to determine where the error is happening? First I would do this:
If that looks good I would move things down and look at img.
I think you are going to find that you are providing the wrong kind of argument to one of the function calls. Hint Hint
def openImg(): fileimg = filedialog.askopenfile(mode = 'rb+', initialdir = "/Desktop/",title = "Select file",filetypes = (("jpeg files","*.jpg"),("png", "*.png"))) print(type(fileimg), fileimg) return content = fileimg.read() img = PhotoImage(file = content) my_label = Label(image = img).grid(row = 3, column = 0)If fileimg is a file I would move the print and return to see what you are getting back for content.
If that looks good I would move things down and look at img.
I think you are going to find that you are providing the wrong kind of argument to one of the function calls. Hint Hint