In Python, I only want to list all the files in the current directory ONLY. I do not want files listed from any sub directory or parent.
There do seem to be similar
You can use the pathlib module.
from pathlib import Path x = Path('./') print(list(filter(lambda y:y.is_file(), x.iterdir())))