Python
class Application(ttk.Frame):
def __init__(self, main_window):
super().__init__(main_window)
main_window.title("Metro Atenas")
self.combo = ttk.Combobox(
state="readonly",
values=estaciones_arr
)
self.combo2 = ttk.Combobox(
state="readonly",
values=estaciones_arr
)
self.combo.place(x=50, y=30)
self.combo2.place(x=50, y=70)
self.button = ttk.Button(
text="Mostrar selección",
command=self.show_selection
)
self.button.place(x=50, y=100)
main_window.config(width=300, height=200)
self.place(width=300, height=200)
def show_selection(self):
seleccion = self.combo.get()
seleccion2 = self.combo2.get()
traza = g.Grafo.a_star(grafo1.grafo_nd, seleccion, seleccion2)
messagebox.showinfo(
message=f"La ruta optima es: {traza}",
title="Selección"
)
main_window = tk.Tk()
app = Application(main_window)
app.mainloop()
Coco/R
B = (. fprintf(parse," %d",4); .) if "(" E ")"
| (. fprintf(parse," %d",5); .) let id T ";"
| (. fprintf(parse," %d",6); .) S
| (. fprintf(parse," %d",7); .) while "(" R ")" "{" C "}"
.
T = (. fprintf(parse," %d",8); .) int
| (. fprintf(parse," %d",9); .) boolean
| (. fprintf(parse," %d",10); .) string
.
F = (. fprintf(parse," %d",11); .) function id H "(" A ")" "{" C "}"
.
S = (. fprintf(parse," %d",12); .) id S1
| (. fprintf(parse," %d",16); .) print E ";"
| (. fprintf(parse," %d",17); .) input id ";"
| (. fprintf(parse," %d",18); .) return X ";"
.
Comments