Skip to content

Commit 89d7ea7

Browse files
committed
v0.5.0
1 parent 4399678 commit 89d7ea7

File tree

2 files changed

+27
-10
lines changed

2 files changed

+27
-10
lines changed

MyCards.py

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#Version:
2-
#0.4.5
2+
#0.5.0
33
###
4+
from ast import Num
45
import os ### Librairie
56
import csv ### .py & Librairie
67
import random ### Librairie
@@ -11,7 +12,7 @@
1112
from language_modules import * ### .py
1213
###
1314
Language=[] #List (will contain the words)
14-
NumberOfWord=-1 #The number of the word in the list (DataBase.csv)
15+
NumberOfWord=0 #The number of the word in the list (DataBase.csv)
1516
GitHub="https://github.com/Hidden-Warden/MyCards/blob/main/README.md" #Link to GitHub ;D
1617
Last_Random=-1
1718
Last_Random_List=[]
@@ -22,7 +23,6 @@
2223
Rappel_CSV_Title=BaseDeMots[0]
2324
Rappel_CSV_Title.pop(0)
2425
print("Rappel_CSV_Title",Rappel_CSV_Title)
25-
BaseDeMots.pop(0) # Delete the first line in BaseDeMots
2626
###
2727
def language(input_language):
2828
##Choice of the language from the settings:
@@ -47,10 +47,12 @@ def Randow_Word():
4747
old_NumberOfWord=NumberOfWord
4848
NumberOfWord=random.randint(0,len(BaseDeMots)-1)
4949
if NumberOfWord==old_NumberOfWord:
50-
NumberOfWord=random.randint(0,len(BaseDeMots)-1)
51-
Update(NumberOfWord)
50+
NumberOfWord=random.randint(0,len(BaseDeMots))
51+
if NumberOfWord==0:
52+
NumberOfWord=1
5253
Last_Random=NumberOfWord
5354
Last_Random_List.append(NumberOfWord)
55+
Update(NumberOfWord)
5456
return NumberOfWord
5557
###
5658
def Next():
@@ -73,12 +75,15 @@ def Back():
7375
Last_Random=-1
7476
NumberOfWord=Last_Random_List[(len(Last_Random_List)-2)]
7577
#print(Last_Random_List)
76-
Update(NumberOfWord)
7778
else:
7879
NumberOfWord-=1
7980
if NumberOfWord<0:
8081
NumberOfWord=0
81-
Update(NumberOfWord)
82+
83+
if NumberOfWord==0:
84+
NumberOfWord=1
85+
86+
Update(NumberOfWord)
8287
return NumberOfWord
8388
###
8489
def GitHubLink():
@@ -120,6 +125,10 @@ def Update(Numéro):
120125
canvas.create_text((s_screen_width/scnd_colonne), (80), text=BaseDeMots[Numéro][1],fill="red", font=s_font_family) ##1
121126
canvas.create_text((s_screen_width/scnd_colonne), (160), text=BaseDeMots[Numéro][2],fill=s_font_color, font=s_font_family) ##2
122127
canvas.create_text((s_screen_width/scnd_colonne), (240), text=BaseDeMots[Numéro][3],fill="green", font=s_font_family) ##3
128+
129+
btn10 = Button(root, text =(Language[11]+str(NumberOfWord)), activebackground=s_button_color_active,bg=s_button_color_unactive,fg=s_button_texte_color,height=s_button_height, width=s_button_width,borderwidth = 0) #Bouton#// About
130+
btn10.place(rely=0, relx=0, x=0, y=600,anchor=W)
131+
123132
#################################################################################################################################
124133
#4
125134
N4_1=("")
@@ -237,10 +246,17 @@ def ImageRelated():
237246
dir_list = os.listdir(path)
238247
##
239248
for loop in range(len(dir_list)):
240-
howmuch=dir_list[loop][3:4] # Get the number of the screenshot for the same word
249+
howmuch=dir_list[loop][3:4] # Get the number of the screenshot for the same word (0-9)
250+
if howmuch=="-":
251+
howmuch=dir_list[loop][4:5]
252+
print(howmuch)
253+
241254
if dir_list[loop]==("#"+str(NumberOfWord)+"-"+howmuch+screenshot_type): # If the screenshot is the for the sale word
242255
print("OK",("#"+str(NumberOfWord)+"-"+howmuch+screenshot_type))
243256
ListScrennshot.append(("#"+str(NumberOfWord)+"-"+howmuch+screenshot_type))
257+
print("How much",howmuch)
258+
print("ListScrennshot",ListScrennshot)
259+
print("num",NumberOfWord)
244260
##
245261
if ListScrennshot==[]:
246262
print("No screenshot for this word")
@@ -341,6 +357,7 @@ def ImageBack():
341357
if super_mode==True:
342358
btn6 = Button(root, text =Language[7], activebackground=s_button_color_active,bg=s_button_color_unactive,fg=s_button_texte_color,height=s_button_height, width=s_button_width,borderwidth = 0,command =GitHubLink) #Bouton#// Super Mode
343359
btn6.pack(anchor=W)
360+
344361
### End of the buttons ###
345362

346363
# Font and size of the buttons

language_modules.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
FR=["Suivant","Retour","Mot aléatoire","Quitter","Menu","Paramètres","À propos","Capture d'écrant","Suivant","Retour"]
2-
EN=["Next","Back","Random word","Quit","Menu","Settings","About","Update CSV","Screenshot","Next","Back"]
1+
FR=["Suivant","Retour","Mot aléatoire","Quitter","Menu","Paramètres","À propos","Capture d'écrant","Suivant","Retour","Carte N°"]
2+
EN=["Next","Back","Random word","Quit","Menu","Settings","About","Update CSV","Screenshot","Next","Back","Card N°"]

0 commit comments

Comments
 (0)