scan all directories with python

Solutions on MaxInterview for scan all directories with python by the best coders in the world

showing results for - "scan all directories with python"
Lucia
04 Mar 2016
1import glob
2
3# path to search single character filename
4path = "sales/?.jpeg"
5for file in glob.glob(path):
6    print(file)
7
8# path to search three-character filename
9path = "sales/???.jpeg"
10for file in glob.glob(path):
11    print(file)
12
13# search file that starts with word 'cha' followed by exact two-character
14path = "sales/cha??.txt"
15for file in glob.glob(path):
16    print(file)
17
Lilas
08 Aug 2017
1import glob
2
3# path to search single character filename
4path = "sales/?.jpeg"
5for file in glob.glob(path):
6    print(file)
7
8# path to search three-character filename
9path = "sales/???.jpeg"
10for file in glob.glob(path):
11    print(file)
12
13# search file that starts with word 'cha' followed by exact two-character
14path = "sales/cha??.txt"
15for file in glob.glob(path):
16    print(file)
17
queries leading to this page
get all folder in directory pythonhow to scan a folder with pythonprint dir pythonpython get all directory names in directorypython get all folders in directorylist all directories pythonaccess in directories using os pythonpython get all sub directoriesget all dirs in directory pathlibfind all folders in path pythonget all folders name in a directory in python how to list all directories present in the directory pythonopen all folders pythonprint all folders in directory pythonread all directories in directory listing using pythonhow to get all the directory name using the pythonget all dirs in directory pathlib ospython3 get all directories from directoryfind all directories in paythonhow to get all directories in folder in pythonprint all directories in folder pythonpython os path scan all folderspython print all dirhow to get all folder names in a directory pythonpython get all directories in directorypython scan directoryhow to get all folders in a directory pythonget all directories pythonfind all folders path in a directory pythonpython get all directories in pathget all folders in directory pythonlist all directories in directory pathlibpython scan directory all sub folderspython show all dirs in folderhow to get all directories in pythonget all directory from directory pythonfunction to print directories and subdirectories pythonhow to get all directories name os in pythonget all directories in path pythonpython find all directoriesprint all folders in a directory pythonget all directory on path pythonscan all directories with python