Paso 2: el código
# Autor: Mohamad Sigit loco# Python: 2.7
# www.tokolampugorontalo.blogspot.com
# www.makebot.blogspot.com
# Dudelectric-microsystems
# Gorontalo 21/06/2013
###################################################
de import Tkinter *
DEF hapus(entry1,entry2,entry3,entry4,entry5):
entry1.Delete (0, final)
entry2.Delete(0,end)
entry3.Delete (0, final)
entry4.Delete(0,end)
entry5.Delete(0,end)
DEF hitungan(entry5):
SV=int(entry1.get())
LV=int(entry2.get())
HM=int(entry3.get())
DC=int(entry4.get())
OP=(SV-(LV*HM))/(float(DC)/1000)
e.set ("%.1f" % op)
ventana = Tk()
raíz = Frame(window)
root.Pack()
Label1 = Label (raíz, texto = "Fuente de voltaje (V)")
Label1.Pack(Side="left")
entry1 = entrada (raíz, ancho = 3, primer plano = "rojo")
entry1.Pack(Side="left")
Label2 = Label (raíz, texto = "Led voltios (V)")
Label2.Pack(Side="left")
entry2 = Entry(root,width=3,foreground="purple")
entry2.Pack(Side="left")
Label3 = Label (raíz, texto = "cuántos leds")
Label3.Pack(Side="left")
Entrada3 = Entry(root,width=3,foreground="blue")
entry3.Pack(Side="left")
label4 = Label (raíz, texto = "Deseado" actual"(mA))
label4.Pack(Side="left")
entry4 = Entry(root,width=4,foreground="orange")
entry4.Pack(Side="left")
Label5 = Label (raíz, texto = "Valor de la resistencia (ohm)")
Label5.Pack(Side="left")
e=StringVar()
entry5 = Entry(root,width=10,background="cyan",highlightcolor="red",foreground="red",textvariable=e)
entry5.Pack(Side="left")
button1 = botón (texto = "GET VALUE",command=lambda:hitungan(entry5)).pack(side=RIGHT)
BUTTON2 = botón (texto = "claro All",command=lambda:hapus(entry1,entry2,entry3,entry4,entry5)).pack(side=BOTTOM)
Window.mainloop()