每当我输入2 * x + 3之类的方程式时,它就会显示Tkinter回调异常this is the error which comes when I enter the equation
from tkinter import *
from matplotlib import pyplot as plt
import numpy as np
def plot():
x=np.array(range(-100,100))
y=eqentry.get()
plt.plot(x,y)
plt.show()
window=Tk()
upframe=Frame(window)
upframe.pack(side=TOP)
downframe=Frame(window)
downframe.pack(side=BOTTOM)
label=Label(upframe,text="Enter Equation")
label.pack()
eqentry=Entry(upframe)
eqentry.pack()
validte=Button(downframe,text="Generate Graph",command=plot)
validate.pack(side=LEFT)
window.mainloop()