title: How do I delete line starting with ">" while reading a file to string in Python
body: <p>I want to read all files ending with ".fasta" in mydir directory one by one and save content except lines starting with ">" to a string called "data" for further analysis while also ignoring newline characters. So far I have this:</p>
  
  <pre><code>for file in os.listdir(mydir):
    if file.endswith(".fasta"):
      with open(file, 'r') as myfile:
        data = myfile.read().replace('\n', '')
  </code></pre>
  
  <p>How do I read file into a string AND in the same command skip all lines starting with ">"?</p>