Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Alter-Sitanshu committed Oct 3, 2024
1 parent 8c30c47 commit 37024fd
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions flash_card/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
BACKGROUND_COLOR = "#B1DDC6"

try:
df = pd.read_csv("data/to_learn.csv")
df = pd.read_csv("flash_card/data/to_learn.csv")
except FileNotFoundError:
df = pd.read_csv("data/french_words.csv")
df = pd.read_csv("flash_card/data/french_words.csv")
data = df.to_dict(orient="records")
else:
data = df.to_dict(orient="records")
Expand All @@ -16,7 +16,7 @@
def know() -> None:
data.remove(random_word)
new_df = pd.DataFrame(data)
new_df.to_csv("data/to_learn.csv", index=None)
new_df.to_csv("flash_card/data/to_learn.csv", index=None)
screen.after_cancel(timer)
new_word()
def dont_know():
Expand All @@ -40,15 +40,15 @@ def flip() -> None:
screen.config(padx=50, pady=50, bg=BACKGROUND_COLOR)

canvas = tk.Canvas(master=screen, width=800, height=526, bg=BACKGROUND_COLOR, highlightthickness=0)
card_front = tk.PhotoImage(file="images/card_front.png")
card_back = tk.PhotoImage(file="images/card_back.png")
card_front = tk.PhotoImage(file="flash_card/images/card_front.png")
card_back = tk.PhotoImage(file="flash_card/images/card_back.png")
card_image = canvas.create_image(400, 263, image= card_front)
title = canvas.create_text(400, 150, text="title", font=("Ariel", 40, "italic"), fill="black")
word = canvas.create_text(400, 252, text="Word", font=("Ariel", 60, "bold"), fill="black")
canvas.grid(column=0, row=0, columnspan=2)

yes_img = tk.PhotoImage(file="images/right.png")
no_img = tk.PhotoImage(file="images/wrong.png")
yes_img = tk.PhotoImage(file="flash_card/images/right.png")
no_img = tk.PhotoImage(file="flash_card/images/wrong.png")
yes = tk.Button(master=screen, image=yes_img, highlightthickness=0, command=know)
no = tk.Button(master=screen, image=no_img, highlightthickness=0, command=dont_know)
yes.grid(column=0, row=1)
Expand Down

0 comments on commit 37024fd

Please sign in to comment.