SyntaxFix
Write A Post
Hire A Developer
Questions
You can use the pathlib module.
from pathlib import Path x = Path('./') print(list(filter(lambda y:y.is_file(), x.iterdir())))