I created a graphing calculator (screen shot is on), and when the button is pressed, it adds text to textctrl so that the equation is displayed to the user. when the user presses the enter button, he takes this text and starts it using eval and then prints using SetValue, but if I run the problem in texctrl, for example, 5/6, it turns out as 0, how can I make a float
def eenter(self,e): a=self.box.GetValue() answer=eval(a) ans=str(answer) self.box.SetValue(ans)
source share