Python writelines() and write() huge time difference
file.writelines() expects an iterable of strings. It then proceeds to loop and call file.write() for each string in the iterable. In Python, the method does this: def writelines(self, lines) for line in lines: self.write(line) You are passing in a single large string, and a string is an iterable of strings too. When iterating you get … Read more