0
此代碼是一個wxglade代碼&它需要一個文本框WHIS的輸入是代數或超越函數如何將字符串轉換爲Python中的代數或超越函數?
def event_2(self, event): # wxGlade: application.<event_handler>
#print "Event handler `event_2' not implemented!"
#event.Skip()
equationString = self.text_ctrl_1.GetValue()
function = eval(equationString)
event.Skip()
它給人的錯誤,你已經把在
Traceback (most recent call last):
File "ppy.py", line 103, in event_2
function = eval(equationString)
File "<string>", line 1, in <module>
NameError: name 'd' is not defined