我的项目的这段代码有很多麻烦,需要用这个代码做一个简单的乘法:错误是“值错误:int()基数10的无效文字:”
def multcalc():
ans1=int(mEntry1.get()) #This is where it's locating the error
ans2=int(mEntry2.get()) #
print(ans1*ans2)
return
multmenu=Tk()
mEntry1=StringVar()
mEntry2=StringVar()
multmenu.geometry('450x450+200+200')
multmenu.title('Multiplication')
input1msg=Label(text='Enter your first input').pack()
input1entry=Entry(multmenu,textvariable=mEntry1).pack()
input2msg=Label(text='Enter your second input').pack()
input2entry=Entry(multmenu,textvariable=mEntry2).pack()
mCalculate=Button(multmenu,text='Enter',command=multcalc).pack()