Get a valur for make some calculates

Hi all,

I have a little gui that provide 4 textctrl for insert some data.
After that the user insert the data I would like to do some operation
with this data like a * b = c but I receive some type error because I
don't have a int variables.

How can I get the value from GetValue() function and use thus like
integer or float number for do the calculates?

---Code---
...
...
self.local = wx.TextCtrl(self.panel, -1, '', pos = (200, 45))
self.scontolocal = wx.TextCtrl(self.panel, -1, '', pos = (200, 75))
...
...
def OnCalculate(self, event):
      tot_local = self.local.GetValue()
      scontolocal_mr = self.scontolocal.GetValue()
      sconto = (tot_local * scontolocal_mr)/100
      res = tot_local - sconto
      self.totscontato = wx.TextCtrl(self.panel, -1, res, pos = (200,
105))
...
...

Thanks
Andrea

Thanks, this work very well for my need.

Bye Andrea

···

On Tue, 2007-04-03 at 13:39 -0400, Mike Rooney wrote:

All you need to do is cast these to ints, which can be done with the
int() method. float() also exists for numbers with decimals. So:

      tot_local = int(self.local.GetValue())
      scontolocal_mr = int(self.scontolocal.GetValue())

You could also be using the new properties to access the value, like

      tot_local = int(self.local.Value)
      scontolocal_mr = int(self.scontolocal.Value)

which I personally prefer.