Python, code works, but openning via bat file get error
<p>Following is a simple working GUI programm. However, when I try to open it from a <code>bat</code> file, it gives an error.</p>

<p>Bat file (2 lines):</p>

<pre><code>ch10.2.py
pause
</code></pre>

<p>The error I receive is:</p>

<p>[error message in text format to be included here]</p>

<p>My code:</p>

<pre><code># Lazy Buttons 2
# Demonstrates using a class with Tkinter

from tkinter import *

class Application(Frame):
    """ A GUI application with three buttons. """ 
    def __init__(self, master):
        """ Initialize the Frame. """
        super(Application, self).__init__(master)    
        self.grid()
        self.create_widgets()

    def create_widgets(self):
        """ Create three buttons that do nothing. """
        # create first button
        self.bttn1 = Button(self, text = "I do nothing!")
        self.bttn1.grid()

        # create second button
        self.bttn2 = Button(self)
        self.bttn2.grid()   
        self.bttn2.configure(text = "Me too!")

        # create third button
        self.bttn3 = Button(self)
        self.bttn3.grid()
        self.bttn3["text"] = "Same here!"

# main
root = Tk()
root.title("Lazy Buttons 2")
root.geometry("200x85")
app = Application(root)
root.mainloop()
</code></pre>

<p>It's giving error on <code>super(Application, self).__init__(master)</code>.<br>
If you replace with <code>Frame.__init__(self, master)</code> , its working.
See below  </p>

<pre><code># Lazy Buttons 2
# Demonstrates using a class with Tkinter

from tkinter import *

class Application(Frame):
    """ A GUI application with three buttons. """

    def __init__(self, master):
        """ Initialize the Frame. """       
        Frame.__init__(self, master)
        #super(Application, self).__init__(master) 
        self.grid()
        self.createWidgets()




    def createWidgets(self):
        """ Create three buttons that do nothing. """
        # create first button
        self.bttn1 = Button(self, text = "I do nothing!")  
        self.bttn1.grid()

        # create second button
        self.bttn2 = Button(self)
        self.bttn2.grid()   
        self.bttn2.configure(text = "Me too!")

        # create third button
        self.bttn3 = Button(self)
        self.bttn3.grid()
        self.bttn3["text"] = "Same here!"


# main
root = Tk()
root.title("Lazy Buttons 2")
root.geometry("200x85")
app = Application(root)
root.mainloop()
</code></pre>

<p><strong>OUTPUT</strong><br>
<a href="http://i.stack.imgur.com/cHekK.png" rel="nofollow"><img src="http://i.stack.imgur.com/cHekK.png" alt="enter image description here"></a></p>

python