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
The examples to os.walk in the documentation show how to do this:
for root, dirs, filenames in os.walk(indir):
for f in filenames:
log = open(os.path.join(root, f),'r')
How did you expect the "open" function to know that the string "1" is supposed to mean "/home/des/test/1" (unless "/home/des/test" happens to be your current working directory)?