How to get rid of NameError in Python?
<p>Hi
I just executed the following code :</p>

<pre><code>from Tkinter import *

class LabelDemo( Frame ):
   def __init__( self ):
      Frame.__init__( self )   

      self.pack( expand = YES, fill = BOTH )
      self.master.title( "Labels" )

      self.Label3 = Label( self, bitmap = "warning" )
      self.Label3.pack( side = LEFT )

if __name__ == "__main__":
   LabelDemo().mainloop() 
</code></pre>

<p>It gives me NameError: name 'LabelDemo' is not defined.</p>

<p>What could be the reason?</p>
