Skip to content
Permalink
127285b54b
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
54 lines (41 sloc) 1.92 KB
import tkinter as tk
from tkinter import messagebox
import subprocess
def crear_interfaz_nueva(titulo):
nueva_ventana = tk.Toplevel(root)
nueva_ventana.title(titulo)
nueva_ventana.geometry("400x300")
nueva_ventana.withdraw() # Ocultar la nueva ventana al principio
etiqueta = tk.Label(nueva_ventana, text="Contenido de la interfaz " + titulo)
etiqueta.pack(pady=20)
def ejecutar_golden():
# Ruta al script que quieres ejecutar
script_path_golden = "scripts/Golden.py"
try:
subprocess.run(["python", script_path_golden], check=True)
except subprocess.CalledProcessError as e:
print(f"Error al ejecutar el script: {e}")
def ejecutar_unimodular():
# Ruta al script que quieres ejecutar
script_path_unimodular = "scripts/Unimodular.py"
try:
subprocess.run(["python", script_path_unimodular], check=True)
except subprocess.CalledProcessError as e:
print(f"Error al ejecutar el script: {e}")
def ejecutar_errores():
# Ruta al script que quieres ejecutar
script_path_errores = "scripts/CorreccionErrores.py"
try:
subprocess.run(["python", script_path_errores], check=True)
except subprocess.CalledProcessError as e:
print(f"Error al ejecutar el script: {e}")
root = tk.Tk()
root.title("From Golden to Unimodular Cryptography")
root.geometry("600x400")
btn_ventana_1 = tk.Button(root, text="Cifrado Golden", command=ejecutar_golden, width=23, height=6, font=('Arial', 14))
btn_ventana_1.grid(row=0, column=0, padx=20, pady=20, sticky="nw")
btn_ventana_2 = tk.Button(root, text="Cifrado Unimodular", command=ejecutar_unimodular, width=23, height=6, font=('Arial', 14))
btn_ventana_2.grid(row=0, column=1, padx=20, pady=20, sticky="ne")
btn_ventana_3 = tk.Button(root, text="Corrección de Errores", command=ejecutar_errores, width=23, height=6, font=('Arial', 14))
btn_ventana_3.grid(row=1, column=0, columnspan=2, pady=20)
root.mainloop()