Jul-31-2022, 11:03 PM
you need to pass the arguments to the function, like:
open_image('image.jpg')
get that to work, and then try creating another function to create the frame ( and return instance)
and then pass that to the
def open_image(imagename): frame = Frame(root,width=200,height=200,bd=5,bg='white') photo = ImageTk.PhotoImage(Image.open(imagename)) photo_label = Label(image=photo) photo_label.pack()and then call like:
open_image('image.jpg')
get that to work, and then try creating another function to create the frame ( and return instance)
and then pass that to the
open_image(framename, imagename):
...