This seems like a very general question, but here is a website that has great granularity, and here is a very simple general example:
import Tkinter as tk
class application:
def __init__(self,window):
""" Initalize the Application """
self.myentrybox = tk.Entry(window)
self.myentrybox.pack()
self.myentrybox.insert(0,"some default value")
self.myentrybox.bind("<Return>",self.Enter)
def Enter(self,event):
""" Someone Pressed Enter """
print "You entered >> %s" % (self.myentrybox.get())
root=tk.Tk()
myapp = application(root)
root.mainloop()
Hope you can extrapolate what you need to know ...
source
share