From 9d75f9aca03454518e22f10a54dd83fc4b931071 Mon Sep 17 00:00:00 2001 From: greg Date: Mon, 12 Jun 2023 17:49:58 +0200 Subject: [PATCH] push maj folder --- README.md | 2 +- input/sample.md | 13 +++++++++++++ md-to-pdf.py | 7 +++---- 3 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 input/sample.md diff --git a/README.md b/README.md index 5e00eeb..861a22c 100644 --- a/README.md +++ b/README.md @@ -14,4 +14,4 @@ python3.10 md-to-pdf.py ## TO DO -- [ ] Dossier input et dossier output pour les batchs \ No newline at end of file +- [x] Dossier input et dossier output pour les batchs \ No newline at end of file diff --git a/input/sample.md b/input/sample.md new file mode 100644 index 0000000..382580d --- /dev/null +++ b/input/sample.md @@ -0,0 +1,13 @@ +# TP PYTHON 9-6-2023 + +## Groupe + +Groupe 4 : Ali, Said. Mathieu, David, Marie + +## Site test choisi + +https://cookingjulia.blogspot.com/' + +## Dificultés rencontrées + +problèmes avec l'utilisation dea méthodes, ect... diff --git a/md-to-pdf.py b/md-to-pdf.py index 442162f..5eca626 100644 --- a/md-to-pdf.py +++ b/md-to-pdf.py @@ -15,15 +15,14 @@ def convert(): def convert_all(): try: - files = os.listdir("./") + files = os.listdir("./input") for file in files: if file.endswith(".md"): pdf = str(file.split(".md")[0]) markdown = file - md2pdf.md2pdf(pdf + ".pdf", "", "./" + markdown, "", "") + md2pdf.md2pdf("./output/" + pdf + ".pdf", "", "./input/" + markdown, "", "") except: print("Un fichier a posé problème: " + file) - continue print("conversion réussie") @@ -39,4 +38,4 @@ def main(): case _: print("choix incorrect, veuillez saisir 1 ou 2") -main() +main() \ No newline at end of file