add lpic101 completed (lpic1_book_101-500.csv) #7
			
				
			
		
		
		
	
							
								
								
									
										16
									
								
								poc_hugo.py
								
								
								
								
							
							
						
						
									
										16
									
								
								poc_hugo.py
								
								
								
								
							| 
						 | 
					@ -9,10 +9,21 @@ from rich.markdown import Markdown
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Open the CSV file and create a dictionary with all the questions
 | 
					# Open the CSV file and create a dictionary with all the questions
 | 
				
			||||||
def _create_dictionary():
 | 
					def _create_dictionary():
 | 
				
			||||||
    with open(path) as file:
 | 
					    answers = input("Choose your question list : \n 1: LPI Essentials \n 2: LPIC 1 101-500 \n")
 | 
				
			||||||
 | 
					    if answers == "1":
 | 
				
			||||||
 | 
					        with open(path1) as file:
 | 
				
			||||||
            reader = csv.DictReader(file)
 | 
					            reader = csv.DictReader(file)
 | 
				
			||||||
            data = list(reader)
 | 
					            data = list(reader)
 | 
				
			||||||
        return data
 | 
					        return data
 | 
				
			||||||
 | 
					    elif answers == "2":
 | 
				
			||||||
 | 
					        with open(path2) as file:
 | 
				
			||||||
 | 
					            reader = csv.DictReader(file)
 | 
				
			||||||
 | 
					            data = list(reader)
 | 
				
			||||||
 | 
					        return data
 | 
				
			||||||
 | 
					    else:
 | 
				
			||||||
 | 
					        print("Please enter a valid value")
 | 
				
			||||||
 | 
					        exit()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def _print_question(question_asked):
 | 
					def _print_question(question_asked):
 | 
				
			||||||
| 
						 | 
					@ -87,7 +98,8 @@ def print_stats(counter):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if __name__ == "__main__":
 | 
					if __name__ == "__main__":
 | 
				
			||||||
    path = "./data/list_book1.csv"
 | 
					    path1 = "./data/list_book1.csv"
 | 
				
			||||||
 | 
					    path2 = "./data/lpic1_book_101-500.csv"
 | 
				
			||||||
    counter = []
 | 
					    counter = []
 | 
				
			||||||
    dictionary = _create_dictionary()
 | 
					    dictionary = _create_dictionary()
 | 
				
			||||||
    random.shuffle(dictionary)
 | 
					    random.shuffle(dictionary)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue