Вы можете получить значения с помощью .get () из виджетов
from tkinter import *
#Create the window
myWindow = Tk()
#Define your formula here
def MyCalculateFunction():
#Get your value from box_pressure
#Remember to convert string to integer or float / double
pressure, temprature = float(box_pressure.get()), float(box_temprature.get())
result = pressure + temprature
#Show your result with label
label_result.config(text="%f + %f = %f" % (pressure, temprature, result))
#Create a input box for pressure
box_pressure = Entry(myWindow)
box_pressure.pack()
#Create a input box for temprature
box_temprature = Entry(myWindow)
box_temprature.pack()
#Create a button
button_calculate = Button(myWindow, text="Calcuate", command=MyCalculateFunction)
button_calculate.pack()
#Create a label
label_result = Label(myWindow)
label_result.pack()
или получите его из textvariable
#Bind it with variable
variable_pressure = DoubleVar()
box_pressure = Entry(myWindow, textvariable=variable_pressure)
box_pressure.pack()
#Get/Set value by .get() / .set()
variable_pressure.set(42)
# shows 42
print(variable_pressure.get())