
Gestor de Productos
Python
Publicado el 23 de Diciembre del 2020 por Alexander (15 códigos)
3.514 visualizaciones desde el 23 de Diciembre del 2020
Aplicación para gestionar productos sencilla:)


from tkinter import *
app = Tk()
app.title = "Formularios"
app.geometry("500x300")
date1 = IntVar()
date2 = IntVar()
resultado = IntVar()
def convert(operando):
if operando == "+":
resultado.set(date1.get() + date2.get())
elif operando == "-":
resultado.set(date1.get() - date2.get())
elif operando == "*":
resultado.set(date1.get() * date2.get())
elif operando == "/":
resultado.set(date1.get() / date2.get())
else:
exit()
label = Label(app, text="Calculator", bg = "red", width = 62, height = 2)
label.grid(row = 0, column = 0, pady = 10 ,columnspan = 12,sticky = W) #Sticky es para pegar a la izquierda
num1 = Label(app, text = "Introduce el primer numero: ").grid(row = 4, column = 0, padx = 3, pady = 3, sticky = W)
entry1 = Entry(app, textvariable = date1).grid(row = 4, column = 1, padx = 3, pady = 3)
num2 = Label(app, text = "Introduce el segundo numero : ").grid(row = 5, column = 0, padx = 3, pady = 3, sticky = W)
entry2 = Entry(app, textvariable = date2).grid(row = 5, column = 1, padx = 3, pady = 3)
sum = Button(app, text = "Sumar", command = lambda: convert("+")).grid(row = 6, column = 0, padx = 1, pady = 1, sticky = W)
res = Button(app, text = "Restar", command = lambda: convert("-")).grid(row = 7, column = 0, padx = 1, pady = 1, sticky = W)
mul = Button(app, text = "Multiplicar", command = lambda: convert("*")).grid(row = 6, column = 1, padx = 1, pady = 1, sticky = W)
div = Button(app, text = "Dividir", command = lambda: convert("/")).grid(row = 7, column = 1, padx = 1, pady = 1, sticky = W)
result = Label(app, textvariable = resultado).grid(row = 8, column = 3)
exit = Button(app, text = "Exit", command = quit).grid(row = 9, column = 3)
app.mainloop()
empaquetar([1, 1, 1, 3, 5, 1, 1, 3, 3]) # [(1, 3), (3, 1), (5, 1), (1, 2), (3, 2)]
empaquetar([1, 2, 3, 3, 3, 1]) # [(1, 1), (2, 1), (3, 3), (1, 1)]
empaquetar([1, 1, 1, 1]) # [(1, 4)]
empaquetar([1, 1, "a", "a", "s", "s"]) # [(1, 2), ('a', 2), ('s', 2)]
empaquetar([]) # []
'
Formula que calcula el jueves santo de cualquier año hasta el 9999. Programado para insertar el año 'en la celda F4.
'***************************************************************************************************************
=MONEDA(("4/"&F4)/7+RESIDUO(19*RESIDUO(F4;19)-7;30)*14%;)*7-9
'El siguiente código debemos insertarlo en un módulo para usar la funcion semana santa y que nos 'muestre la fecha del jueves santo desde cualquier celda.
'***************************************************************************************************************
Public Function SemanaSanta(Año As Integer) As Date
SemanaSanta = Evaluate("DOLLAR((""4/""&" & Año & ")/7+MOD(19*MOD(" & Año & ",19)-7,30)*14%,)*7-9")
End Function
isStrongPassword("Fran2#xo"); // true
isStrongPassword("2Franxo!"); // true
isStrongPassword("2Fran!"); // false
isStrongPassword("contraseña"); // false
isStrongPassword("fran2#xo"); // false
isStrongPassword(" Fran2#xo"); // false
isStrongPassword("Fran2#xo "); // false
isStrongPassword("Fran2#xo"); // true
isStrongPassword("2Franxo!"); // true
isStrongPassword("2Fran!"); // false
isStrongPassword("contraseña"); // false
isStrongPassword("fran2#xo"); // false
isStrongPassword(" Fran2#xo"); // false
isStrongPassword("Fran2#xo "); // false