Calculadora con python 2.4
Hoy se les comparte el aplicativo en lenguaje Python 2.4 de una calculadora, usando la libreria Tkinter. Codigo fuente: #by Pedro Gustavo Montesinos Berrocal from Tkinter import * ventana = Tk() ventana.title("Calculadora by Pedro Montesinos") i = 0 #Entrada e_texto = Entry(ventana, font=("calibri 20")) e_texto.grid(row = 0, column = 0, columnspan = 4, padx = 50, pady = 5) #funciones def click_boton(valor): global i e_texto.insert(i, valor) i+=1 def borrar(): e_texto.delete(0, END) i = 0 def hacer_operacion(): ecuacion = e_texto.get() resultado = eval(ecuacion) e_texto.delete(0, END) e_texto.insert(0, resultado) i = 0 #Botones boton1 = Button(ventana, text ="1", width = 5, height = 2 , command = lambda: click_boton(1)) boton2 = Button(ventana, text ="2", width = 5, height = 2 , command = lambda: click_boton(2)) boton3 = Button(ventana, text ="3", width = 5, height = 2 , command = lambda: click_boton(3)) boton4 = Butt...