From b2de0e105af71bc0c02ed0030e8129c03149ae78 Mon Sep 17 00:00:00 2001 From: Ezekiel Date: Fri, 28 May 2021 11:59:44 +0200 Subject: [PATCH] first push --- poc_hugo.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 poc_hugo.py diff --git a/poc_hugo.py b/poc_hugo.py new file mode 100644 index 0000000..4dc2cc3 --- /dev/null +++ b/poc_hugo.py @@ -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() \ No newline at end of file