I want to add two or more files in just one file with all info. My code is:
def add_file(filenames, output_file):
with open(output_file, 'w') as master_file:
master_file.write('C/A,UNIT,SCP,DATEn,TIMEn,DESCn,ENTRIESn,EXITSn\n')
for filename in filenames:
with open(filename, 'r') as infile:
master_file.write(infile.read())
When I call to put all files like this:
add_file('turnstile_170603.txt','out.txt')
Show:
IOError: [Errno 2] No such file or directory: 't'
Why? What I did wrong?