title: How do I create a variable accessible by any function in a class in python?
body: <p>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. </p>
  
  <pre><code>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()
  </code></pre>