I have some code inside of a class. I want my load variable to be accessible by any function in my class, so I put my variable directly in the class. I get the error: NameError: name 'load' is not defined.
load = Image.open('obama.jpg')
def showImg(self):
render = ImageTk.PhotoImage(load)
img = Label(self, image=render)
img.image = render
img.place(x=0,y=0)
def hideImg(self):
load.close()
def hideImg(self):, I mean, doesselfserve any purpose?