Pathlib obtém lista de arquivos
for path in pathlib.Path(".").iterdir():
if path.is_file():
print(path)
Inquisitive Ibis
for path in pathlib.Path(".").iterdir():
if path.is_file():
print(path)
import pathlib
import os
directory: pathlib.Path = some/path/_object
for file in os.listdir(directory.__str__()):
file_path: pathlib.Path = directory / file
pass