Fonction pour charger le dictionnaire et début de mise en forme du programme
This commit is contained in:
		
							
								
								
									
										12
									
								
								wgamesolv.py
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								wgamesolv.py
									
									
									
									
									
								
							@@ -62,10 +62,9 @@ parser.add_argument(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
args = parser.parse_args()
 | 
					args = parser.parse_args()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Dictionary
 | 
					def load_dict(dict_file):
 | 
				
			||||||
if args.dictionary:
 | 
					 | 
				
			||||||
    try :
 | 
					    try :
 | 
				
			||||||
        with open(args.dictionary, "r") as dico:
 | 
					        with open(dict_file, "r") as dico:
 | 
				
			||||||
            liste = json.load(dico)
 | 
					            liste = json.load(dico)
 | 
				
			||||||
    except:
 | 
					    except:
 | 
				
			||||||
        print("Impossible d'ouvrir le fichier" + fp)
 | 
					        print("Impossible d'ouvrir le fichier" + fp)
 | 
				
			||||||
@@ -198,6 +197,13 @@ if bl:
 | 
				
			|||||||
        if invalidate == 0:
 | 
					        if invalidate == 0:
 | 
				
			||||||
            blFilter.append(mot)
 | 
					            blFilter.append(mot)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if __name__ == "__main__":
 | 
				
			||||||
 | 
					    liste = load_dict(args.dictionary)
 | 
				
			||||||
 | 
					    liste = resolv_len(liste, nb)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Affiche du résultat  
 | 
					# Affiche du résultat  
 | 
				
			||||||
if pattern and kl and bl:
 | 
					if pattern and kl and bl:
 | 
				
			||||||
    print(", ".join(blFilter))
 | 
					    print(", ".join(blFilter))
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user