Beispiel #1
0
def call_fabricator_news():
    lab = tk.Label(text="The Fabricator.com news", padx=5, pady=20)
    lab.grid(row=11, column=0, sticky="W")
    nwsf=News()
    lstf=nwsf.fabricator() #Calling fabricator method

    lstf_values = list(lstf.values())   #value list from fabricator.com site*
    lstf_keys = list(lstf.keys())#key list from fabricator.com site
    lksf = [i for i in range(10)]

    lksf[0] = tk.Label(text=f"1. {lstf_keys[0]}", fg="blue", cursor="hand2")
    lksf[0].bind('<Button-1>', lambda j: open_link(lstf_values[0]))
    lksf[0].grid(row=12, column=0, sticky="W")

    lksf[1] = tk.Label(text=f"2. {lstf_keys[1]}", fg="blue", cursor="hand2")
    lksf[1].bind('<Button-1>', lambda j: open_link(lstf_values[1]))
    lksf[1].grid(row=13, column=0, sticky="W")

    lksf[2] = tk.Label(text=f"3. {lstf_keys[2]}", fg="blue", cursor="hand2")
    lksf[2].bind('<Button-1>', lambda j: open_link(lstf_values[2]))
    lksf[2].grid(row=14, column=0, sticky="W")

    lksf[3] = tk.Label(text=f"4. {lstf_keys[3]}", fg="blue", cursor="hand2")
    lksf[3].bind('<Button-1>', lambda j: open_link(lstf_values[3]))
    lksf[3].grid(row=15, column=0, sticky="W")

    lksf[4] = tk.Label(text=f"5. {lstf_keys[4]}", fg="blue", cursor="hand2")
    lksf[4].bind('<Button-1>', lambda j: open_link(lstf_values[1]))
    lksf[4].grid(row=16, column=0, sticky="W")

    lksf[5] = tk.Label(text=f"6. {lstf_keys[1]}", fg="blue", cursor="hand2")
    lksf[5].bind('<Button-1>', lambda j: open_link(lstf_values[5]))
    lksf[5].grid(row=17, column=0, sticky="W")

    lksf[6] = tk.Label(text=f"7. {lstf_keys[6]}", fg="blue", cursor="hand2")
    lksf[6].bind('<Button-1>', lambda j: open_link(lstf_values[6]))
    lksf[6].grid(row=18, column=0, sticky="W")

    lksf[7] = tk.Label(text=f"8. {lstf_keys[7]}", fg="blue", cursor="hand2")
    lksf[7].bind('<Button-1>', lambda j: open_link(lstf_values[7]))
    lksf[7].grid(row=19, column=0, sticky="W")

    lksf[8] = tk.Label(text=f"9. {lstf_keys[8]}", fg="blue", cursor="hand2")
    lksf[8].bind('<Button-1>', lambda j: open_link(lstf_values[8]))
    lksf[8].grid(row=20, column=0, sticky="W")

    lksf[9] = tk.Label(text=f"10. {lstf_keys[9]}", fg="blue", cursor="hand2")
    lksf[9].bind('<Button-1>', lambda j: open_link(lstf_values[9]))
    lksf[9].grid(row=21, column=0, sticky="W")