Answers for "how to get each filename in a directory in python"

3

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:
Posted by: Guest on July-03-2020

Code answers related to "how to get each filename in a directory in python"

Python Answers by Framework

Browse Popular Code Answers by Language