🚧 tqdm
This commit is contained in:
parent
f9bc468a56
commit
9856062227
4 changed files with 8 additions and 6 deletions
|
@ -1,5 +1,6 @@
|
|||
import os
|
||||
import subprocess
|
||||
from tqdm import tqdm
|
||||
|
||||
input_dir = "recipes-md"
|
||||
output_dir = "recipes-mediawiki"
|
||||
|
@ -7,7 +8,7 @@ output_dir = "recipes-mediawiki"
|
|||
os.makedirs(output_dir, exist_ok=True)
|
||||
|
||||
# Process each markdown file in the input directory
|
||||
for filename in os.listdir(input_dir):
|
||||
for filename in tqdm(os.listdir(input_dir)):
|
||||
if filename.endswith(".md"):
|
||||
input_path = os.path.join(input_dir, filename)
|
||||
output_filename = os.path.splitext(filename)[0] + ".mediawiki"
|
||||
|
@ -22,7 +23,6 @@ for filename in os.listdir(input_dir):
|
|||
"-t", "mediawiki",
|
||||
"-o", output_path
|
||||
], check=True)
|
||||
print(f"Converted {filename} to {output_filename}")
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f"Error converting {filename}: {e}")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue