From c90e14caa121751d0f58ee8efae302ec288ba9a1 Mon Sep 17 00:00:00 2001 From: TokioMiyaoka <miyaoka.tokio@tis.co.jp> Date: Sat, 17 Feb 2024 15:32:59 +0900 Subject: [PATCH] judge if files directory and output_files directory are exist --- main.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 6f4c98d..d4b47f4 100644 --- a/main.py +++ b/main.py @@ -4,9 +4,12 @@ import os import shutil -# lattice=Trueでテーブルの軸線でセルを判定 -os.mkdir("./files") -os.mkdir("./output_files") +if not os.path.exists("./files"): + os.mkdir("./files") + +if not os.path.exists("./output_files"): + os.mkdir("./output_files") + dfs = tabula.read_pdf("000876235.pdf", lattice=True, pages='all', pandas_options={'header': None}) i = 0 for df in dfs: