找到hermitdave的github很利害
from tkinter import *
# ---------------------------- UI SETUP -------------------------------
Navy = "#B1DDC6"
root = Tk()
root.title("Flashy")
root.config(padx=50, pady=50, bg=Navy)
canvas = Canvas(width=800, height=526, highlightthickness=0)
card_front_img = PhotoImage(file='.\\images\\card_front.png')
canvas.create_image(400, 263, image=card_front_img)
canvas.create_text(400, 150, text='Title', font=("Ariel", 40, "italic"))
canvas.create_text(400, 263, text='word', font=("Ariel", 60, "bold"))
canvas.config(bg=Navy, highlightthickness=0)
canvas.grid(column=0, row=0, columnspan=2)
yes_image = PhotoImage(file='.\\images\\\\right.png')
yes_button = Button(image=yes_image, highlightthickness=0)
yes_button.grid(column=1, row=1)
no_image = PhotoImage(file='.\\images\\wrong.png')
no_button = Button(image=no_image, highlightthickness=0)
no_button.grid(column=0, row=1)
root.mainloop()
HINT:
You could use:
DataFrame.to_dict(orient="records")