first push
This commit is contained in:
parent
263cd92a1e
commit
b2de0e105a
|
@ -0,0 +1,26 @@
|
||||||
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
import pathlib
|
||||||
|
import time
|
||||||
|
import os
|
||||||
|
import csv
|
||||||
|
import random
|
||||||
|
from collections import Counter
|
||||||
|
from rich.console import Console
|
||||||
|
from rich.markdown import Markdown
|
||||||
|
|
||||||
|
def _create_dictionnary():
|
||||||
|
with open(path) as file:
|
||||||
|
reader = csv.DictReader(file)
|
||||||
|
data = list(reader)
|
||||||
|
|
||||||
|
question = random.choice(data)
|
||||||
|
return question
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
path = "./data/list_book1.csv"
|
||||||
|
_create_dictionnary()
|
||||||
|
print(get_random_question())
|
||||||
|
|
||||||
|
|
||||||
|
print()
|
Loading…
Reference in New Issue