Answers for "find file names python"

6

python get all file names in a dir

from os import listdir
from os.path import isfile, join
onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))]
Posted by: Guest on April-04-2020
1

python find file name

filesName = list(map(os.path.basename, glob.glob("..yourPath*txt")))
print(filesName)
Posted by: Guest on January-31-2021

Python Answers by Framework

Browse Popular Code Answers by Language