I have a folder with ten files in it which I want to loop through. When I print out the name of the file my code works fine:
import os indir = \'/home/des/te
You have to specify the path that you are working on:
source = '/home/test/py_test/' for root, dirs, filenames in os.walk(source): for f in filenames: print f fullpath = os.path.join(source, f) log = open(fullpath, 'r')