for subdir, dirs, files in os.walk(crawlFolder):
for file in files:
print os.getcwd()
f=open(file,'r')
lines=f.readlines()
writeFile.write(lines)
f.close()
writeFile.close()
I get the error as:-
IOError: [Errno 2] No such file or directory
In reference to my partial python code above:-
print os.getcwd() --> C:\search engine\taxonomy
however, the file is located in the directory "C:\search engine\taxonomy\testFolder"
I know the error is because it works in the current directory and I need to append the directory testFolder with file somehow. Could someone please correct my code and help me out with this? Thank you.