I have getting confused in getting the value from the Tkinter() Entry Field. I have this kind of code...
from Tkinter import*
def valueGET(val1, val2):
print val1 + " " + val2
class ContentUI():
def showLogin(self, frame):
self.contentUI = ContentUI()
L1 = Label(frame, text="Name")
L1.pack( side = LEFT)
L1.grid()
E1 = Entry(frame, bd =5)
E1.pack(side = RIGHT)
E1.grid()
L2 = Label(frame, text="Secret")
L2.pack( side = LEFT)
L2.grid()
E2 = Entry(frame, bd =5, show="*")
E2.pack(side = RIGHT)
E2.grid()
submit = Button(frame, text="Enter", width=15, command=valueGET(E1.get(), E2.get()))
submit.grid()
class UIDisplay():
def play(self):
root = Tk()
root.title(title)
root.geometry(dimension)
app = Frame(root)
contentUI = ContentUI()
contentUI.showLogin(app)
app.grid()
root.mainloop()
adkooPlay = UIDisplay()
adkooPlay.play()
but it seems my valueGET(val1, val2) method is not working, it didn't print the value or even get it by using the get() method of the Tkinter() Entry, did I do wrong? and how should it be done?
thanks in advance ...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…