I want to read multiple text files in the folder. I am using os.listdir() to get every file in my folder. I'm using open to read the text file and write to write the file. However, an error comes out when I run the code. Here I attached the code.
import os
infilename = os.listdir("C:\Python27\input")
for filename in infilename:
f = open(filename, "r")
data = f.read()
f.close()