title: how to open and read multiple .txt files
body: <p>This question has been asked before by a friend, but we got no answer. </p>
  
  <p>We need to open and read 35 text files with <code>.txt</code> extension from my directory. The purpose of opening and reading these files is to put all the texts into only one file in sequence. The files are enumerated from 1 to 35 (e.g. Chapter1.txt, Chapter2.txt....Chapter35.txt)  </p>
  
  <p>I've tried loop through all the files of my directory opening and reading them to append them a list, but I got always an error message that does not make sense because all the files are in the directory:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/Users/nataliaresende/Dropbox/PYTHON/join_files.py", line 
  27, in &lt;module&gt;
      join_texts()
    File "/Users/nataliaresende/Dropbox/PYTHON/join_files.py", line 
  14, in join_texts
      with open (file) as x:
  FileNotFoundError: [Errno 2] No such file or directory: 
  'Chapter23.txt'
  
  import sys
  import os
  from pathlib import Path
  
  def join_texts():
  
      files_list=[]
  
      files_directory = Path(input('Enter the path of the files: '))
  
      for file in os.listdir(files_directory):
          for f in file:
              with open (file) as x:
                  y=x.read()
                  files_list.append(y)
      a=' '.join(files_list)
      print(a)
  
  join_texts()
  </code></pre>
  
  <p>I need to create a final file that has the content of all these .txt files included sequentially. Can anyone help me with the coding? </p>