list of files in a directory python code example
Example 1: list files python
#get all .txt files in my_path
import glob
my_path='/home/folder/'
files=glob.glob(my_path+'*.txt')
Example 2: read all files in folder python
import glob
print(glob.glob("/home/adam/*.txt"))