title: Python NameError: name 'frame' is not defined (Tkinter)
body: <p>Here is the code:</p>
  
  <pre><code>#!/usr/bin/python
  from tkinter import *
  
  class App:
      def _init_(self, master):
  
          frame = Frame(master)
          frame.pack()
  
      self.lbl = Label(frame, text = "Hello World!\n")
      self.lbl.pack()
  
      self.button = Button(frame, text="Quit", fg="red", command=frame.quit)
      self.button.pack(side=LEFT)
  
      self.hi_there = Button(frame, text="Say hi!", command=self.say_hi)
      self.hi_there.pack(side=LEFT)
  
      def say_hi(self):
          print("Hello!")
  
      root = Tk()
      root.title("Hai")
      root.geometry("200x85")
      app = App(root)
      root.mainloop()
  </code></pre>
  
  <p>And here, the error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "F:/HTML/HTMLtests/python/hellotkinter2.py", line 4, in &lt;module&gt;
      class App:
    File "F:/HTML/HTMLtests/python/hellotkinter2.py", line 10, in App
      self.lbl = Label(frame, text = "Hello World!\n")
  NameError: name 'frame' is not defined
  </code></pre>
  
  <p>Can't find where it went wrong! Appreciate any helps!</p>