0

I'm working on an exercise which is the merging of three files into a new file with the current date as the file name; this is the error i get "SyntaxError: unexpected EOF while parsing", please help. My code is:

file_name = datetime.datetime.now()

def createFile(lst):
    with open(file_name.strftime("%Y-%m-%d-%H-%M-%f")+".txt","w") as myFile:
        for i in lst:
            myFile.write(i+"\n")

file_list = ["file1.txt","file2.txt","file3.txt"]
lst = []

for j in file_list:
    with open(j,"r") as i:
        lst.append(i.readlines())

createFile(lst)

The Error Message is:

File "exrFile.py", line 11
                                         ^
SyntaxError: unexpected EOF while parsing
Seun
  • 1

0 Answers0