如何提取變量的數字變量,到後來進行計算與: 例如Tkinter的進入,如何利用已經使用
from tkinter import *
import math
root = Tk()
root.mainloop()
# ............
entry1 = Entry(root)
entry2 = Entry(root)
def sum():
puhs = math.sqrt(enttry1.get()/entry2.get())
rel = Label(root,text=puhs)
rel.pack()
#---the problem
rad2 = (entry1*puhs) # this is where I get the error
rel2 = Label(root, text=rad2)
rel2.pack()
calc = Button(root, text="pulse", command= sum)
calc.pack()
rpta = Label(root, text="puhs")
rpta.pack()
我的問題是,我該如何使用變量「推「用它來創造更多的計算?
你的意思是'不puhs''push'我猜?在你的代碼中似乎一致是一個錯字。 – roganjosh