title: How to "join" two text files with python?
body: <p>I have two txt files like this:
  txt1:</p>
  
  <pre><code>Foo
  Foo
  Foo
  Foo
  </code></pre>
  
  <p>txt2:</p>
  
  <pre><code>Bar
  Bar
  Bar
  Bar
  </code></pre>
  
  <p>How can I concatenate them in a new file by the left and the right side let's say like this:</p>
  
  <pre><code>Bar Foo
  Bar Foo
  Bar Foo
  Bar Foo
  </code></pre>
  
  <p>I tried the following:</p>
  
  <pre><code>folder = ['/Users/user/Desktop/merge1.txt', '/Users/user/Desktop/merge2.txt']
  with open('/Users/user/Desktop/merged.txt', 'w') as outfile:
      for file in folder:
          with open(file) as newfile:
              for line in newfile:
                  outfile.write(line)
  </code></pre>