How to bind the return key to a function on the frame/form itself
<p>I'm making an app which has a sort of splash screen made in tkinter, and I would like it to close and call and run another part of the app, however i cannot for the life of me figure out why my bind won't work.</p>

<p>Do keep in mind I started python about 2 weeks ago so I'm still very much a learner, any help would be greatly appreciated! 
I am aware that similar questions have been answered on here, however none of the questions have the windows as part of a class, and I'm having a hard time implementing the solutions into my code as a result.</p>

<p>The code:</p>

<pre><code>from Tkinter import *
from PIL import ImageTk
from PIL import Image
import time
class intro(Frame):
    global master
    master = Tk()
    #master.attributes("-fullscreen", TRUE)
    global img
    img = ImageTk.PhotoImage(Image.open("dorina.jpeg"))

    def __init__(self, master=None):
        Frame.__init__(self, master)
        self.grid()
        self.nameLabel = Label(master, image=img)
        self.nameLabel.grid()
        checker = False
        self.bind("&lt;Return&gt;", lambda e: self.destroy())





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

<p>This time as an answer and I hope it helps.</p>

<p>The following works for me:</p>

<pre><code>import Tkinter as tk

class simpleapp_tk(tk.Tk):
    def __init__(self, parent):
        ## class derives from Tkinter --&gt; call its constructor
        tk.Tk.__init__(self, parent)
        ## keep track of the parent
        self.parent = parent

    self.bind("&lt;Return&gt;", lambda x: self.destroy())


if __name__ == "__main__":
    app = simpleapp_tk(None)
    app.title('test')
    #app.wm_attributes('-topmost', 1) # always on top
    app.mainloop()
</code></pre>

python user-interface tkinter binding key