create folder if not exist
This commit is contained in:
parent
53f40ef725
commit
8fec12133b
@ -7,7 +7,7 @@ import shutil
|
||||
# return True
|
||||
# return False
|
||||
NUMBER_OF_ANSWERS = 5
|
||||
BASE_FODLER = "test_data"
|
||||
# BASE_FODLER = "test_data"
|
||||
|
||||
|
||||
class QuestionAndAnswers:
|
||||
@ -29,6 +29,10 @@ def convert(csv_path, output_pdf=False):
|
||||
def write_markdown_file(csv_path):
|
||||
# csv_path = "quiz-example.csv"
|
||||
OUTPUT_FODLER = "output"
|
||||
|
||||
if not os.path.exists(OUTPUT_FODLER):
|
||||
os.makedirs(OUTPUT_FODLER)
|
||||
|
||||
markdown_filename = "slide-deck.md"
|
||||
markdown_path = os.path.join(OUTPUT_FODLER, markdown_filename)
|
||||
|
||||
|
@ -51,6 +51,10 @@ def upload_image():
|
||||
from werkzeug.utils import secure_filename
|
||||
filename = secure_filename(csv_file.filename)
|
||||
output_file_path = os.path.join(UPLOAD_FODLER, filename)
|
||||
|
||||
if not os.path.exists(UPLOAD_FODLER):
|
||||
os.makedirs(UPLOAD_FODLER)
|
||||
|
||||
csv_file.save(output_file_path)
|
||||
|
||||
# run converter
|
||||
|
Loading…
x
Reference in New Issue
Block a user