SyntaxFix
Write A Post
Hire A Developer
Questions
It's preferable to use context managers to close the files automatically
with open("new.txt", "r"), open('xyz.txt', 'w') as textfile, myfile: for line in textfile: var1, var2 = line.split(","); myfile.writelines(var1)