Im a beginner in Python and running into the following problem:
for an assignment i need to get the number that gets inserted into text1, then when i push the button pk<<<kw multiply it by 1.36 and insert it into text2. and reverse by pressing the other button.
only i have no clue how.
from tkinter import *
root= Tk()
root.title("python programma omrekenen")
root.geometry("300x200")
def Iets():
label = Label(text="vermogen in pk:")
label.place(x=50,y=50)
text1=IntVar()
entry1=Entry(textvariable=text1)
entry1.place(x=150,y=50)
x1=text1.get()
def Functie 10:
def Functie 11:
button=Button (text="PK>>>KW", command=Functie10)
button.place (x=50,y=100)
button=Button (text="PK<<<KW", command=functie11)
button.place (x=150,y=150)
label = Label(text="vermogen in KW:")
label.place(x=50,y=150)
text2=IntVar()
entry2=Entry(textvariable=text2)
entry2.place(x=150,y=150)
x2=text2.get()
root.mainloop()
sorry for the bad english
command
is used to call a function.In your case , it does a multiplication on a number and gets inserted into an entry field.
Also ,
delete
&insert
are 2 tkinter methods clear & insert the data respectively