My Blog

My Little TreeHole
偶尔 Post 有趣的事或文章
  1. Main page
  2. Coding
  3. Main content

Coding

01/12/2022 78hotness 0likes 0comments

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 ";" 
    .

Tag: coco/r code learn python
Last updated:01/12/2022

Me

Although I am not very skilled at writing, I will endeavor to get better. English, Spanish, or Chinese will all be used for my writing, as desired. ("maybe french")

Like
< Last article

Comments

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
Cancel

COPYRIGHT © 2022 My Blog. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang