11#Version:
2- #0.4.5
2+ #0.5.0
33###
4+ from ast import Num
45import os ### Librairie
56import csv ### .py & Librairie
67import random ### Librairie
1112from language_modules import * ### .py
1213###
1314Language = [] #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)
1516GitHub = "https://github.com/Hidden-Warden/MyCards/blob/main/README.md" #Link to GitHub ;D
1617Last_Random = - 1
1718Last_Random_List = []
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###
2727def 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###
5658def 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###
8489def 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():
341357if 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
0 commit comments