You are on page 1of 1

#Graficos en python

#http://www.science.smith.edu/dftwiki/index.php/Color_Charts_for_TKinter
from tkinter import *

def suma():
Num1 = txt1.get()
Num2 = txt2.get()
Suma = float(Num1) + float(Num2)
txt3.delete(0,END)#Borra
txt3.insert(0,Suma)

Wind = Tk()
Wind.geometry("600x300")
Wind.title("Calculadora")
Wind.resizable(False,False)
Wind.configure(background="light slate blue")

Lb1 = Label(Wind,text="Primer número",bg="snow")


Lb1.place(x=10,y=10,width=100,height=30)
txt1 = Entry(Wind,bg="DarkSlateGray2")
txt1.place(x=120,y=10,width=100,height=30)

Btn1 = Button(Wind,text="Suma",bg="PaleVioletRed3",command=suma)
Btn1.place(x=350,y=10,width=100,height=30)

Lb2 = Label(Wind,text="Segundo número",bg="snow")


Lb2.place(x=10,y=50,width=100,height=30)
txt2 = Entry(Wind,bg="DarkSlateGray2")
txt2.place(x=120,y=50,width=100,height=30)

txt3 = Entry(Wind,bg="gray91")
txt3.place(x=230,y=10,width=100,height=30)

Wind.mainloop()

You might also like