# EntryTest.py """Test the Entry widget""" from Tkinter import * class Application(Frame): def __init__(self, master=None): Frame.__init__(self, master) self.grid() self.name = StringVar() self.name.set("Enter name here") self.age = IntVar() self.age.set("Enter age here") self.createWidgets() def createWidgets(self): self.textEntry = Entry(self, takefocus=1, textvariable = self.name, width = 40) self.textEntry.grid(row=0, sticky=E+W) self.ageEntry = Entry(self, takefocus=1, textvariable = self.age, width = 20) self.ageEntry.grid(row=1, sticky=W) # end class Application myApp = Application() myApp.mainloop()