python read every file in directory code example
Example 1: for every file in the folder do python
for file in os.listdir(inputdir):
Example 2: python open each file in directory
import os
for filename in os.listdir(os.getcwd()):
with open(os.path.join(os.cwd(), filename), 'r') as f:
Example 3: os list all files in one dir
import glob
print(glob.glob("/home/adam/*.txt"))