Frequency Dictionary.mp3

找到hermitdave的github很利害

FireShot Capture 032 - 100 Days of Code_ The Complete Python Pro Bootcamp for 2022 - Udemy_ - www.udemy.com.png

FireShot Capture 033 - 100 Days of Code_ The Complete Python Pro Bootcamp for 2022 - Udemy_ - www.udemy.com.png

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()

2022-06-20.png

Step 2 - Create New Flash Cards

FireShot Capture 033 - 100 Days of Code_ The Complete Python Pro Bootcamp for 2022 - Udemy_ - www.udemy.com.png

  1. Read the data from the french_words.csv file in the data folder.
  2. Pick a random French word/translation and put the word into the flashcard. Every time you press the ❌ or ✅ buttons, it should generate a new random word to display. e.g.

HINT:

  1. You'll need to use pandas to access the CSV file and generate a data frame. To get all the words/translation rows out as a list of dictionaries e.g. [{french_word: english_word}, {french_word2: english_word2}, {french_word3: english_word3}]

You could use:

DataFrame.to_dict(orient="records")