Mar-05-2024, 06:12 PM
You should look at pathlib as a replacement for os.scandir. Instead of this:
import os def text_existing(path): obj = os.scandir(path) for entry in obj: if entry.name.endswith(".pdf"):You could do this:
from pathlib import Path def text_existing(path): for entry in Path(path).glob("*.pdf"):