title: How do I concatenate text files in Python?
body: <p>I have a list of 20 file names, like <code>['file1.txt', 'file2.txt', ...]</code>. I want to write a Python script to concatenate these files into a new file. I could open each file by <code>f = open(...)</code>, read line by line by calling <code>f.readline()</code>, and write each line into that new file. It doesn't seem very &quot;elegant&quot; to me, especially the part where I have to read/write line by line.</p>
  <p>Is there a more &quot;elegant&quot; way to do this in Python?</p>