我在制作GUI时遇到Tkinter回调异常问题

时间:2019-08-31 08:03:52

标签: tkinter matplotlib-basemap

每当我输入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()

0 个答案:

没有答案