Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/01/2010, 17:37
Avatar de pato12
pato12
 
Fecha de Ingreso: septiembre-2007
Ubicación: Salta
Mensajes: 1.620
Antigüedad: 16 años, 7 meses
Puntos: 101
Problema al sumar

Hola,
Estoy aprendiendo python, y intento sumar los valores de 2 campos:
Código Python:
Ver original
  1. def resolver(self,event):
  2.         if self.accion=='sumar':
  3.              self.resultado_final.SetLabel(self.numero.GetValue()+self.con.GetValue())
  4.         if self.accion=='restar':
  5.              self.resultado_final.SetLabel(self.numero.GetValue()-self.con.GetValue())
  6.         if self.accion=='dividir':
  7.              self.resultado_final.SetLabel(self.numero.GetValue()/self.con.GetValue())
  8.         if self.accion=='multiplicar':
  9.              self.resultado_final.SetLabel(self.numero.GetValue()*self.con.GetValue())
Si tengo 5 en uno, y en el otro 2 me da: 52 (porque los uno, no suma :S)
y al dividir, multiplicar y restar me da error :S
Gracias
Salu2
__________________
Half Music - www.halfmusic.com