Read data from Entry : Entry : Tkinker PYTHON TUTORIALS


PYTHON TUTORIALS » Tkinker » Entry »

 

Read data from Entry


Read data from Entry
from Tkinter import *
from math import *
def calc():
    result = "= " + str(eval(expression.get()))
    label.config(text = result)

root = Tk()
frame = Frame(root)
label = Label(frame)
entry = Entry(frame)
expression = StringVar()
entry["textvariable"= expression 
button = Button(frame, text = "=", command = calc)
frame.pack()
entry.pack()
label.pack(side=LEFT)
button.pack(side=RIGHT)
frame.mainloop()



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Tkinker
» Entry