commit ea05d7ccfecdd43df812fb14309470c733dbb624 Author: tuz Date: Sun Nov 23 15:41:35 2025 -0500 add python diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..176a458 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto diff --git a/A-Z_Archives_OrderScriptPython-main/A-ZPythonFoldersScript.py b/A-Z_Archives_OrderScriptPython-main/A-ZPythonFoldersScript.py new file mode 100644 index 0000000..a3a8647 --- /dev/null +++ b/A-Z_Archives_OrderScriptPython-main/A-ZPythonFoldersScript.py @@ -0,0 +1,35 @@ +import os +import shutil + +print("!Warning this script delete all empty folders in the directory it was executed in [v0.9️]¡") +print("1 Start") +print("0 Close") +x = input("") +if x == "1": + index_list = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "ñ", "o", "p", "q", "r", "s", + "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", + "N", "Ñ", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", ] + + while True: + for x in index_list: + if os.path.exists(f"{x}"): + pass + else: + os.mkdir(f"{x}") + print(f"{x}") + break + + while True: + for x in index_list: + home_letter = x + container = [_ for _ in os.listdir() if _.startswith(home_letter)] + for i in container: + shutil.move(i, x) + break + + for item in os.listdir(os.getcwd()): + if os.path.isdir(item): + if not os.listdir(item): + os.removedirs(os.path.join(os.getcwd(), item)) +else: + pass diff --git a/A-Z_Archives_OrderScriptPython-main/CategoryPythonScript.py b/A-Z_Archives_OrderScriptPython-main/CategoryPythonScript.py new file mode 100644 index 0000000..f885184 --- /dev/null +++ b/A-Z_Archives_OrderScriptPython-main/CategoryPythonScript.py @@ -0,0 +1,115 @@ +import os +import shutil + +print("!Warning this script delete all empty folders in the directory it was executed in [v0.9️]¡") +print("1 Start") +print("0 Close") +x = input("") + +if x == "1": + index_list = {"documents", "photos", "videos", "music", "compressed", "software", "programming", "others"} + + documents = [".afpub", ".pdf", ".doc", ".docx", ".txt", ".odt", ".odp", ".odg", ".ods", ".xlsx", ".ppt", ".pptx"] + + photos = [".jpg", ".png", ".gif", ".webp", ".pdf", ".afdesign", ".afphoto", ".sai2", ".sai", ".bmp", ".tiff"] + + videos = [".mp4", ".mkv", ".avi", ".mov", ".flv", ".divx", ".webm", ".swf"] + + music = [".mp3", ".aac", ".wav", ".aiff", ".wma", ".opus", ".ogg"] + + compressed = [".rar", ".7z", ".zip", ".msi", ".bz2", ".gz", ".tar", ".wim", ".xz"] + + software = [".deb", ".exe"] + + programming = [".go", ".py", ".html", ".css", ".php", ".js", ".rs", ".md", ".json", ".gitattributes"] + + others = [".tmp", ".dat", ".dmg"] + + while True: + for x in index_list: + if os.path.exists(f"{x}"): + pass + else: + os.mkdir(f"{x}") + break + + while True: + for x in documents: + extension_name = x + container = [_ for _ in os.listdir() if _.endswith(extension_name)] + for i in container: + shutil.move(i, "documents") + break + + while True: + for x in photos: + extension_name = x + container = [_ for _ in os.listdir() if _.endswith(extension_name)] + for i in container: + shutil.move(i, "photos") + break + + while True: + for x in videos: + extension_name = x + container = [_ for _ in os.listdir() if _.endswith(extension_name)] + for i in container: + shutil.move(i, "videos") + break + + while True: + for x in music: + extension_name = x + container = [_ for _ in os.listdir() if _.endswith(extension_name)] + for i in container: + shutil.move(i, "music") + break + + while True: + for x in compressed: + extension_name = x + container = [_ for _ in os.listdir() if _.endswith(extension_name)] + for i in container: + shutil.move(i, "compressed") + break + + while True: + for x in software: + extension_name = x + container = [_ for _ in os.listdir() if _.endswith(extension_name)] + for i in container: + shutil.move(i, "software") + break + + while True: + for x in programming: + extension_name = x + container = [_ for _ in os.listdir() if _.endswith(extension_name)] + for i in container: + shutil.move(i, "programming") + break + + while True: + for x in others: + extension_name = x + container = [_ for _ in os.listdir() if _.endswith(extension_name)] + for i in container: + shutil.move(i, "others") + break + + while True: + + for item in os.listdir(os.getcwd()): + if os.path.isdir(item): + if not os.listdir(item): + os.removedirs(os.path.join(os.getcwd(), item)) + + break + + for item in os.listdir(os.getcwd()): + if os.path.isdir(item): + if not os.listdir(item): + os.removedirs(os.path.join(os.getcwd(), item)) + +else: + pass diff --git a/A-Z_Archives_OrderScriptPython-main/README.md b/A-Z_Archives_OrderScriptPython-main/README.md new file mode 100644 index 0000000..af45cd7 --- /dev/null +++ b/A-Z_Archives_OrderScriptPython-main/README.md @@ -0,0 +1,24 @@ +# A-Z_Archives_OrderScriptPython + +This is a test of python file manager + +### ⚠️Warning this script delete all empty folders in the directory it was executed in [v0.9️]⚠️ + +#### Category | Python script + +Sorts files by the extencion and put it in a category in the directory [Example: document] + +[CategoryPythonScript.py] + +#### A-Z | Python script + +Sorts files by the first letter of the and move them to a folder with their first letter in the directory [A-Z] + +[A-ZPythonFoldersScript.py] + +#### RemoveEmptyFolders | Python script + +RemoveEmptyFolders in the directory + +[RemoveEmptyFolders.py] + diff --git a/A-Z_Archives_OrderScriptPython-main/RemoveEmptyFolders.py b/A-Z_Archives_OrderScriptPython-main/RemoveEmptyFolders.py new file mode 100644 index 0000000..bcfeccc --- /dev/null +++ b/A-Z_Archives_OrderScriptPython-main/RemoveEmptyFolders.py @@ -0,0 +1,17 @@ +import os + +print("!Warning this script delete all empty folders in the directory it was executed in [v0.9️]¡") +print("1 Start") +print("0 Close") +x = input("") + +if x == "1": + while True: + for item in os.listdir(os.getcwd()): + if os.path.isdir(item): + if not os.listdir(item): + os.removedirs(os.path.join(os.getcwd(), item)) + + break +else: + pass diff --git a/calculadora/Aplicacion.exe b/calculadora/Aplicacion.exe new file mode 100644 index 0000000..2c96a74 Binary files /dev/null and b/calculadora/Aplicacion.exe differ diff --git a/calculadora/App.py b/calculadora/App.py new file mode 100644 index 0000000..0212dd8 --- /dev/null +++ b/calculadora/App.py @@ -0,0 +1,1262 @@ +#importacion de bibliotecas + +from tkinter import * +import math +import tkinter as tk + +#crear ventana +class MyVentana(Frame): + + def __init__(self, master=None): + super().__init__(master) + + self.master=master + self.master.title("Calculadora") + self.master.iconbitmap("calculadora.ico") + self.master.resizable(False,False) + self.iniciar() + +#///////////////////////////////////////////////// Cimponentes ////////////////////////////////////////////////////////////////////////////////////////// + +#CREAR MODO BASICO" + + def iniciar(self): + + # clear contenedores + self.contenedormodNor=tk.Frame(master=self.master,width=300, height=390, bg='gray7') + + # posisionar contenedores + self.contenedormodNor.pack(fill=tk.Y, side=tk.LEFT) + +# crear elementos + + #la caja de texto + self.pantallaNor=Text(self.contenedormodNor, state="disabled", width=10, height=3, background="gray9", foreground="DeepSkyBlue2", font=("Helvetica", 45)) + #posisionar + self.pantallaNor.grid(row=0, column=0, columnspan=5, padx=5, pady=5) + + #botones normal + + self.bmenu=tk.Button(self.contenedormodNor, width=5, height=2, text="\u2630", bg='RoyalBlue4',font=("Helvetica", 15), command = lambda: self.craravans() ).grid(row=1, column=0, padx=0, pady=1) + self.bc=tk.Button(self.contenedormodNor, width=5, height=2, text="C", bg='RoyalBlue4', font=("Helvetica", 15), command = lambda: self.borrar() ).grid(row=1, column=4,padx=0, pady=1) + + + +#fila 2 + self.b1 = tk.Button(self.contenedormodNor, width=5, height=2, text="1", bg='DeepSkyBlue4', font=("Helvetica", 15), command = lambda: self.click_boton(1) ).grid(row=3,column=0,padx=0,pady=1) + self.b2 = tk.Button(self.contenedormodNor, width=5, height=2, text="2", bg='DeepSkyBlue4', font=("Helvetica", 15), command = lambda: self.click_boton(2) ).grid(row=3,column=1,padx=0,pady=1) + self.b3 = tk.Button(self.contenedormodNor, width=5, height=2, text="3", bg='DeepSkyBlue4', font=("Helvetica", 15), command = lambda: self.click_boton(3) ).grid(row=3, column=2,padx=0, pady=1) + self.bdiv = tk.Button(self.contenedormodNor, width=5, height=2, text="/", bg='DeepSkyBlue2', font=("Helvetica", 15), command = lambda: self.click_boton("/") ).grid(row=3, column=3,padx=0, pady=1) + self.bpot = tk.Button(self.contenedormodNor, width=5, height=2, text="\u221A", bg='DeepSkyBlue2', font=("Helvetica", 15), command = lambda: self.raiz() ).grid(row=3, column=4,padx=0, pady=1) + +#fila 3 + self.b4 = tk.Button(self.contenedormodNor, width=5, height=2, text="4", bg='DeepSkyBlue4', font=("Helvetica", 15), command = lambda: self.click_boton(4) ).grid(row=4,column=0,padx=0,pady=1) + self.b5 = tk.Button(self.contenedormodNor, width=5, height=2, text="5", bg='DeepSkyBlue4', font=("Helvetica", 15), command = lambda: self.click_boton(5) ).grid(row=4,column=1,padx=0,pady=1) + self.b6 = tk.Button(self.contenedormodNor, width=5, height=2, text="6", bg='DeepSkyBlue4', font=("Helvetica", 15), command = lambda: self.click_boton(6) ).grid(row=4, column=2,padx=0, pady=1) + self.bmul= tk.Button(self.contenedormodNor, width=5, height=2, text="*", bg='DeepSkyBlue2', font=("Helvetica", 15), command = lambda: self.click_boton("*") ).grid(row=4, column=3,padx=0, pady=1) + self.braiz = tk.Button(self.contenedormodNor, width=5, height=2, text="(", bg='DeepSkyBlue2', font=("Helvetica", 15), command = lambda: self.click_boton("(") ).grid(row=4, column=4,padx=0, pady=1) + + +#fila 4 + self.b7 = tk.Button(self.contenedormodNor, width=5, height=2, text="7", bg='DeepSkyBlue4', font=("Helvetica", 15), command = lambda: self.click_boton(7) ).grid(row=5,column=0,padx=0,pady=1) + self.b8 = tk.Button(self.contenedormodNor, width=5, height=2, text="8", bg='DeepSkyBlue4', font=("Helvetica", 15), command = lambda: self.click_boton(8) ).grid(row=5,column=1,padx=0,pady=1) + self.b9 = tk.Button(self.contenedormodNor, width=5, height=2, text="9", bg='DeepSkyBlue4', font=("Helvetica", 15), command = lambda: self.click_boton(9) ).grid(row=5, column=2,padx=0, pady=1) + self.bres = tk.Button(self.contenedormodNor, width=5, height=2, text="-", bg='DeepSkyBlue2', font=("Helvetica", 15), command = lambda: self.click_boton("-") ).grid(row=5, column=3,padx=0, pady=1) + self.bsigno = tk.Button(self.contenedormodNor, width=5, height=2, text=")", bg='DeepSkyBlue2', font=("Helvetica", 15), command = lambda: self.click_boton(")") ).grid(row=5, column=4,padx=0, pady=1) + +#fila 5 + self.b0 = tk.Button(self.contenedormodNor, width=11, height=2, text="0", bg='DeepSkyBlue4', font=("Helvetica", 15), command = lambda: self.click_boton(0) ).grid(row=6,column=0,columnspan=2,padx=0,pady=1) + self.bpun = tk.Button(self.contenedormodNor, width=5, height=2, text=".", bg='DeepSkyBlue2', font=("Helvetica", 15), command = lambda: self.click_boton(".") ).grid(row=6, column=2,padx=0, pady=1) + self.bsum = tk.Button(self.contenedormodNor, width=5, height=2, text="+", bg='DeepSkyBlue2', font=("Helvetica", 15), command = lambda: self.click_boton("+") ).grid(row=6, column=3,padx=0, pady=1) + self.bigual = tk.Button(self.contenedormodNor, width=5, height=2, text="=", bg='DeepSkyBlue2', font=("Helvetica", 15), command = lambda: self.operacion() ).grid(row=6, column=4,padx=0, pady=1) + + + +# CREAR MODO AVANZADO + + def craravans(self): + global x + x+=1 + + if(x==1): + + #crear si si existe + self.contenedormodAbn = tk.Frame(master=self.master, width=280, height=390, bg='gray9') + self.contenedormodAbn.pack(fill=tk.Y, side=tk.LEFT) + + # la caja de texto para el ID 70164163 + + self.idestudiante = Text(self.contenedormodAbn, state="disabled", width=13, height=1, background="gray9",foreground="SlateBlue2", font=("Helvetica", 12, "bold")) + + # posisionar + self.idestudiante.grid(row=0, column=0, columnspan=5, padx=5, pady=5) + # Escrivir id + self.idestudiante.configure(state="normal") + self.idestudiante.insert("1.0", "RUCHIMISOFTH") + self.idestudiante.configure(state="disabled") + + # fila 1 funciones + self.bed = tk.Button(self.contenedormodAbn, width=6, height=2, text="x^y", bg='DeepSkyBlue4', font=("Helvetica", 15),command=lambda: self.click_boton("**")).grid(row=1, column=0, padx=0, pady=1) + self.bpi = tk.Button(self.contenedormodAbn, width=6, height=2, text="Pi", bg='DeepSkyBlue4',font=("Helvetica", 15), command=lambda: self.pisi()).grid(row=1, column=1, padx=0,pady=1) + self.bsin = tk.Button(self.contenedormodAbn, width=6, height=2, text="sin", bg='DeepSkyBlue4',font=("Helvetica", 15), command=lambda: self.seno()).grid(row=1, column=2, padx=0,pady=1) + self.btan = tk.Button(self.contenedormodAbn, width=6, height=2, text="tan", bg='DeepSkyBlue4',font=("Helvetica", 15), command=lambda: self.tange()).grid(row=1, column=3, padx=0,pady=1) + self.bne = tk.Button(self.contenedormodAbn, width=6, height=2, text="n!", bg='DeepSkyBlue4',font=("Helvetica", 15), command=lambda: self.facto()).grid(row=1, column=4, padx=0,pady=1) + + + + # fila 2 funciones + self.bex=tk.Button(self.contenedormodAbn, width=6, height=2, text="n_n", bg='RoyalBlue4', font=("Helvetica", 15)).grid(row=2, column=1, padx=0, pady=1) + self.bohis = tk.Button(self.contenedormodAbn, width=6, height=2, text="BH", bg='RoyalBlue4',font=("Helvetica", 15), command=lambda: self.boristo()).grid(row=2, column=2,padx=0, pady=1) + self.bfrac = tk.Button(self.contenedormodAbn, width=6, height=2, text="Frac", bg='RoyalBlue4',font=("Helvetica", 15), command=lambda: self.desi()).grid(row=2, column=3, padx=0,pady=1) + + # la caja de texto para el historial + self.historial = Text(self.contenedormodAbn, state="disabled", width=30, height=10, background="gray9",foreground="DeepSkyBlue2", font=("Helvetica", 15,"bold")) + # posisionar + self.historial.grid(row=3, column=0, columnspan=5, padx=5, pady=5) + + # fila1Memoria + self.bmc1 = tk.Button(self.contenedormodAbn, width=6, height=1, text="MC", bg='RoyalBlue4',font=("Helvetica", 15), command=lambda: self.memoriC()).grid(row=4, column=0, padx=1, pady=4), + self.bmr1 = tk.Button(self.contenedormodAbn, width=6, height=1, text="MR", bg='DeepSkyBlue4',font=("Helvetica", 15), command=lambda: self.memoriR()).grid(row=4, column=1, padx=1, pady=4) + self.bms1 = tk.Button(self.contenedormodAbn, width=6, height=1, text="MS", bg='RoyalBlue4',font=("Helvetica", 15),command=lambda: self.memoriS()).grid(row=4, column=2, padx=1, pady=4) + self.bma1 = tk.Button(self.contenedormodAbn, width=6, height=1, text="M+", bg='DeepSkyBlue4',font=("Helvetica", 15), command=lambda: self.memorimas()).grid(row=4, column=3, padx=1, pady=4) + self.bmm1 = tk.Button(self.contenedormodAbn, width=6, height=1, text="M-", bg='DeepSkyBlue2', font=("Helvetica", 15), command=lambda: self.memorires()).grid(row=4, column=4, padx=1, pady=4) + + # fila 2 + self.bmc = tk.Button(self.contenedormodAbn, width=6, height=1, text="MC", bg='RoyalBlue4',font=("Helvetica", 15), command=lambda: self.memoriC2()).grid(row=5, column=0,padx=0, pady=1) + self.bmr = tk.Button(self.contenedormodAbn, width=6, height=1, text="MR", bg='DeepSkyBlue4', font=("Helvetica", 15), command=lambda: self.memoriR2()).grid(row=5, column=1, padx=0, pady=1) + self.bms = tk.Button(self.contenedormodAbn, width=6, height=1, text="MS", bg='RoyalBlue4',font=("Helvetica", 15), command=lambda:self.memoriS2()).grid(row=5, column=2, padx=0, pady=1) + self.bma = tk.Button(self.contenedormodAbn, width=6, height=1, text="M+", bg='DeepSkyBlue4',font=("Helvetica", 15), command=lambda: self.memorimas2()).grid(row=5, column=3,padx=0, pady=1) + self.bme = tk.Button(self.contenedormodAbn, width=6, height=1, text="M-", bg='DeepSkyBlue2',font=("Helvetica", 15), command=lambda: self.memorires2()).grid(row=5, column=4,padx=0, pady=1) + + elif(x==2 or x>2): + + #destruir si + x=0 + self.contenedormodAbn.destroy() + + + +#/////////////////////////////////////////////////// FUNCIONES BAsicas ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 + + + + #Escrivir en pantalla + + def click_boton(self,valor): + + global i,op + + if(op==0): + self.pantallaNor.configure(state="normal") + self.pantallaNor.insert(i, valor) + self.pantallaNor.configure(state="disabled") + i += 1.0 + else: + i = 1.0 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete(i, END) + self.pantallaNor.insert(i, valor) + self.pantallaNor.configure(state="disabled") + i += 1.0 + op = 0 + return + + # borrar + + def borrar(self): + global i,op + i = 1.0 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete(i, END) + self.pantallaNor.configure(state="disabled") + op=0 + return + + #borrar historial + + def boristo(self): + global i,op + + i = 1.0 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete(i,END) + self.pantallaNor.configure(state="disabled") + + self.historial.configure(state="normal") + self.historial.delete(i,END) + self.historial.configure(state="disabled") + + op=0 + return + + + def operacion(self): + + global i, resultado,ecuasion,op,x + + try: + ecuasion=self.pantallaNor.get(1.0, END+"-1c") + resultado=eval(ecuasion) + + + except ZeroDivisionError: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR(/0)") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR(/0)") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", ecuasion) + self.historial.insert("1.0", "____________") + self.pantallaNor.configure(state="disabled") + + except SyntaxError: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR(Syntax)") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR(Syntax)") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", ecuasion) + self.historial.insert("1.0", "____________") + self.pantallaNor.configure(state="disabled") + + except SyntaxWarning: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR(Syntax) ") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR(Syntax)") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", ecuasion) + self.historial.insert("1.0", "____________") + self.pantallaNor.configure(state="disabled") + + except TypeError: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR(Syntax)") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR(Syntax)") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", ecuasion) + self.historial.insert("1.0", "____________") + self.pantallaNor.configure(state="disabled") + else: + + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", resultado) + self.pantallaNor.configure(state="disabled") + + op += 1 + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", resultado) + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "=") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", ecuasion) + self.historial.insert("1.0", "____________") + self.historial.configure(state="disabled") + + return + +#/////////////////////////////////////////////////////////////////FUNCIONES AVANSADAS////////////////////////////////////////////////////////////////// + + def raiz(self): + + global i, resultado, ecuasion, op, x + try: + ecuasion = float(self.pantallaNor.get(1.0, END + "-1c")) + resultado =math.sqrt(ecuasion) + + except ValueError: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR(Syntax)") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR(Syntax)") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "Error") + self.historial.insert("1.0", "\u221A") + self.historial.insert("1.0", "____________") + self.pantallaNor.configure(state="disabled") + + else: + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.configure(state="disabled") + + self.pantallaNor.configure(state="normal") + self.pantallaNor.insert("1.0", resultado) + self.pantallaNor.configure(state="disabled") + + op += 1 + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", resultado) + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "=") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", ecuasion) + self.historial.insert("1.0", "\u221A") + self.historial.insert("1.0", "____________") + self.historial.configure(state="disabled") + + return + + def pisi(self): + + global i, op, x,pi + + try: + pi=math.pi + + except ValueError: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR(Syntax)") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR(Syntax)") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "Error") + self.historial.insert("1.0", "Pi") + self.historial.insert("1.0", "____________") + self.pantallaNor.configure(state="disabled") + + else: + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0",pi) + self.pantallaNor.configure(state="disabled") + + op += 1 + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", pi) + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "=") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "Pi") + self.historial.insert("1.0", "____________") + self.historial.configure(state="disabled") + + def seno(self): + + global i, resultado, ecuasion, op, x,ecuasionw + + try: + ecuasionw= float(self.pantallaNor.get(1.0, END + "-1c")) + ecuasion=math.radians(ecuasionw) + resultado = math.sin(ecuasion) + + except ValueError: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR(Syntax)") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR(Syntax)") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "Error") + self.historial.insert("1.0", "Sin") + self.historial.insert("1.0", "____________") + self.pantallaNor.configure(state="disabled") + + else: + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", resultado) + self.pantallaNor.configure(state="disabled") + + op += 1 + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", resultado) + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "=") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", ecuasionw) + self.historial.insert("1.0", "Sin") + self.historial.insert("1.0", "____________") + self.historial.configure(state="disabled") + + def tange(self): + + global i, resultado, ecuasion, op, x,ecuasionw + + try: + ecuasionw = float(self.pantallaNor.get(1.0, END + "-1c")) + ecuasion = math.radians(ecuasionw) + resultado = math.tan(ecuasion) + + except ValueError: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR(Syntax)") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR(Syntax)") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "Error") + self.historial.insert("1.0", "Tan") + self.historial.insert("1.0", "____________") + self.pantallaNor.configure(state="disabled") + + else: + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", resultado) + self.pantallaNor.configure(state="disabled") + + op += 1 + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", resultado) + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "=") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", ecuasionw) + self.historial.insert("1.0", "Tan") + self.historial.insert("1.0", "____________") + self.historial.configure(state="disabled") + + def facto(self): + + global i, resultado, op, x, ecuasionw + + try: + ecuasionw = int(self.pantallaNor.get(1.0, END + "-1c")) + + if(ecuasionw>100): + + resultado =0 + + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR(Numero grande)") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR de Memoria(Numero grande) ") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "Error") + self.historial.insert("1.0", "Fac") + self.historial.insert("1.0", "____________") + self.pantallaNor.configure(state="disabled") + + else: + resultado = math.factorial(ecuasionw) + + except ValueError: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR(Syntax)") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR(Syntax)") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "Error") + self.historial.insert("1.0", "Fac") + self.historial.insert("1.0", "____________") + self.pantallaNor.configure(state="disabled") + + else: + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", resultado) + self.pantallaNor.configure(state="disabled") + + op += 1 + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", resultado) + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "=") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", ecuasionw) + self.historial.insert("1.0", "Fac") + self.historial.insert("1.0", "____________") + self.historial.configure(state="disabled") + return + + def desi(self): + + global i, resultado, op, x, ecuasionw,rue,rde,im + + try: + + ecuasionw = float(self.pantallaNor.get(1.0, END + "-1c")) + rue,rde=math.modf(ecuasionw) + im=rue + + except ValueError: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR(Syntax)") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR(Syntax)") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "Error") + self.historial.insert("1.0", "Frac") + self.historial.insert("1.0", "____________") + self.pantallaNor.configure(state="disabled") + + else: + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", resultado) + self.pantallaNor.configure(state="disabled") + + op += 1 + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", im) + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "=") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", ecuasionw) + self.historial.insert("1.0", "Fac") + self.historial.insert("1.0", "____________") + self.historial.configure(state="disabled") + return +#/////////////////////////////////////////////////////////////Funciones de memoria /////////////////////////////////////////////////////////////////////// + +#Memoria 1 + + def memoriS(self): + + global i, resultadom1, ecuasionm1, op, x, memoria1 + + try: + ecuasionm1 = self.pantallaNor.get(1.0, END + "-1c") + resultadom1 = eval(ecuasionm1) + + + except ZeroDivisionError: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR M1") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR M1 No Guardado") + self.historial.insert("1.0", "\n") + self.pantallaNor.configure(state="disabled") + + except SyntaxError: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR M1") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR M1 No Guardado") + self.historial.insert("1.0", "\n") + self.pantallaNor.configure(state="disabled") + + except SyntaxWarning: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR M1") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR M1 No Guardado") + self.historial.insert("1.0", "\n") + self.pantallaNor.configure(state="disabled") + + except TypeError: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR M1") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR M1 No Guardado ") + self.historial.insert("1.0", "\n") + self.pantallaNor.configure(state="disabled") + else: + memoria1=resultadom1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "GUARDADO ") + self.pantallaNor.configure(state="disabled") + + op += 1 + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "GUARDADO M1 ") + self.historial.insert("1.0", "\n") + self.historial.configure(state="disabled") + + return + + def memoriR(self): + + global i, op, x, memoria1 + + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", memoria1) + self.pantallaNor.configure(state="disabled") + + op += 1 + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0",memoria1) + self.historial.insert("1.0", " M1:") + self.historial.insert("1.0", "\n") + self.historial.configure(state="disabled") + return + + def memoriC(self): + + global i, op, x, memoria1 + + memoria1=0.0 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", memoria1) + self.pantallaNor.configure(state="disabled") + + op += 1 + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", " Basio ") + self.historial.insert("1.0", " M1:") + self.historial.insert("1.0", "\n") + self.historial.configure(state="disabled") + return + + def memorimas(self): + + global i, resultadom1, ecuasionm1, op, x, memoria1,mesu + + try: + ecuasionm1 = self.pantallaNor.get(1.0, END + "-1c") + mesu=eval(ecuasionm1) + resultadom1=memoria1+mesu + + + except ZeroDivisionError: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR M1 ") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR M1 No Sumado ") + self.historial.insert("1.0", "\n") + self.pantallaNor.configure(state="disabled") + + except SyntaxError: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR M1 ") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR M1 No Sumado ") + self.historial.insert("1.0", "\n") + self.pantallaNor.configure(state="disabled") + + except SyntaxWarning: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR M1 ") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR M1 No Sumado ") + self.historial.insert("1.0", "\n") + self.pantallaNor.configure(state="disabled") + + except TypeError: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR M1 ") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR M1 No Sumado ") + self.historial.insert("1.0", "\n") + self.pantallaNor.configure(state="disabled") + else: + memoria1=resultadom1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "GUARDADO ") + self.pantallaNor.configure(state="disabled") + + op += 1 + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "_M1 ") + self.historial.insert("1.0", mesu) + self.historial.insert("1.0", "SUMADO:") + self.historial.insert("1.0", "\n") + self.historial.configure(state="disabled") + + return + + + def memorires(self): + + global i, resultadom1, ecuasionm1, op, x, memoria1,mesu + + try: + ecuasionm1 = self.pantallaNor.get(1.0, END + "-1c") + mesu=eval(ecuasionm1) + resultadom1=memoria1-mesu + + + except ZeroDivisionError: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR M1 ") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR M1 No Restado") + self.historial.insert("1.0", "\n") + self.pantallaNor.configure(state="disabled") + + except SyntaxError: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR M1 ") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR M1 No Restado ") + self.historial.insert("1.0", "\n") + self.pantallaNor.configure(state="disabled") + + except SyntaxWarning: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR M1 ") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR M1 No Restado ") + self.historial.insert("1.0", "\n") + self.pantallaNor.configure(state="disabled") + + except TypeError: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR ") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR M1 No Restado ") + self.historial.insert("1.0", "\n") + self.pantallaNor.configure(state="disabled") + else: + memoria1=resultadom1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "GUARDADO ") + self.pantallaNor.configure(state="disabled") + + op += 1 + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "_M1 ") + self.historial.insert("1.0", mesu) + self.historial.insert("1.0", "Restado:") + self.historial.insert("1.0", "\n") + self.historial.configure(state="disabled") + + return + +#memoria 2 + + def memoriS2(self): + + global i, resultadom1, ecuasionm1, op, x, memoria2 + + try: + ecuasionm1 = self.pantallaNor.get(1.0, END + "-1c") + resultadom1 = eval(ecuasionm1) + + + except ZeroDivisionError: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR M2 ") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR M2 No Guardado ") + self.historial.insert("1.0", "\n") + self.pantallaNor.configure(state="disabled") + + except SyntaxError: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR M2 ") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR M2 No Guardado ") + self.historial.insert("1.0", "\n") + self.pantallaNor.configure(state="disabled") + + except SyntaxWarning: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR M2 ") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR M2 No Guardado ") + self.historial.insert("1.0", "\n") + self.pantallaNor.configure(state="disabled") + + except TypeError: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR M2 ") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR M2 No Guardado ") + self.historial.insert("1.0", "\n") + self.pantallaNor.configure(state="disabled") + else: + memoria2=resultadom1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "GUARDADO ") + self.pantallaNor.configure(state="disabled") + + op += 1 + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "GUARDADO M2 ") + self.historial.insert("1.0", "\n") + self.historial.configure(state="disabled") + + return + + def memoriR2(self): + + global i, op, x, memoria2 + + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", memoria2) + self.pantallaNor.configure(state="disabled") + + op += 1 + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0",memoria2) + self.historial.insert("1.0", " M2:") + self.historial.insert("1.0", "\n") + self.historial.configure(state="disabled") + return + + def memoriC2(self): + + global i, op, x, memoria2 + + memoria2=0.0 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", memoria2) + self.pantallaNor.configure(state="disabled") + + op += 1 + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", " Basio ") + self.historial.insert("1.0", " M2:") + self.historial.insert("1.0", "\n") + self.historial.configure(state="disabled") + return + + def memorimas2(self): + + global i, resultadom1, ecuasionm1, op, x, memoria2,mesu + + try: + ecuasionm1 = self.pantallaNor.get(1.0, END + "-1c") + mesu=eval(ecuasionm1) + resultadom1=memoria2+mesu + + + except ZeroDivisionError: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR M2 ") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR M2 No Sumado ") + self.historial.insert("1.0", "\n") + self.pantallaNor.configure(state="disabled") + + except SyntaxError: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR M2 ") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR M2 No Sumado ") + self.historial.insert("1.0", "\n") + self.pantallaNor.configure(state="disabled") + + except SyntaxWarning: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR M2 ") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR M2 No Sumado ") + self.historial.insert("1.0", "\n") + self.pantallaNor.configure(state="disabled") + + except TypeError: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR M2 ") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR M2 No Sumado ") + self.historial.insert("1.0", "\n") + self.pantallaNor.configure(state="disabled") + else: + memoria2=resultadom1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "GUARDADO ") + self.pantallaNor.configure(state="disabled") + + op += 1 + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "_M2 ") + self.historial.insert("1.0", mesu) + self.historial.insert("1.0", "SUMADO:") + self.historial.insert("1.0", "\n") + self.historial.configure(state="disabled") + + return + + + def memorires2(self): + + global i, resultadom1, ecuasionm1, op, x, memoria2,mesu + + try: + ecuasionm1 = self.pantallaNor.get(1.0, END + "-1c") + mesu=eval(ecuasionm1) + resultadom1=memoria2-mesu + + + except ZeroDivisionError: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR M2 ") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR M2 No Restado ") + self.historial.insert("1.0", "\n") + self.pantallaNor.configure(state="disabled") + + except SyntaxError: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR M2 ") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR M2 No Restado ") + self.historial.insert("1.0", "\n") + self.pantallaNor.configure(state="disabled") + + except SyntaxWarning: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR M2 ") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR M2 No Restado ") + self.historial.insert("1.0", "\n") + self.pantallaNor.configure(state="disabled") + + except TypeError: + op += 1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "ERROR M2 ") + self.pantallaNor.configure(state="disabled") + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "ERROR M2 No Restado ") + self.historial.insert("1.0", "\n") + self.pantallaNor.configure(state="disabled") + else: + memoria2=resultadom1 + self.pantallaNor.configure(state="normal") + self.pantallaNor.delete("1.0", END) + self.pantallaNor.insert("1.0", "GUARDADO ") + self.pantallaNor.configure(state="disabled") + + op += 1 + + if (x > 0): + self.historial.configure(state="normal") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "\n") + self.historial.insert("1.0", "_M2 ") + self.historial.insert("1.0", mesu) + self.historial.insert("1.0", "Restado:") + self.historial.insert("1.0", "\n") + self.historial.configure(state="disabled") + + return + + + +#contadores y variavles + +i=1.0# +x=0 +op=0 + +pi=0.0 +rue=0.0 +rde=0.0 +im=0.0 + +memoria1=0.0 +memoria2=0.0 + + + +ecuasionw=0.0 +resultado="" +ecuasion="" + +resultadom1="" +ecuasionm1="" +re="" + +#ventana +vent=Tk() +app=MyVentana(vent) +app.mainloop() \ No newline at end of file diff --git a/calculadora/Readme.md b/calculadora/Readme.md new file mode 100644 index 0000000..c2e49e4 --- /dev/null +++ b/calculadora/Readme.md @@ -0,0 +1,18 @@ +# Calculadora py + +![calculadora](./app.png) + + +## Exe + +```sh +pip install pyinstaller + + +pyinstaller --onefile -w App.py -i calculadora.ico +``` + + +## Ref + +[PYINSTALLER: CREANDO EJECUTABLES EN PYTHON | TUTORIAL](https://www.youtube.com/watch?v=4zPS8oQma4k) diff --git a/calculadora/app.png b/calculadora/app.png new file mode 100644 index 0000000..ba7adb2 Binary files /dev/null and b/calculadora/app.png differ diff --git a/calculadora/calculadora.ico b/calculadora/calculadora.ico new file mode 100644 index 0000000..d291738 Binary files /dev/null and b/calculadora/calculadora.ico differ