title: Explicit line joining in Python
body: <p>I am reading a file, line-by-line and doing some text processing in order to get output in a certain format
  My string processing code goes as follows: </p>
  
  <pre><code>file1=open('/myfolder/testfile.txt')
  scanlines=file1.readlines()
  string = ''
  
   for line in scanlines:
      if line.startswith('&gt;from'):
           continue
      if line.startswith('*'):
          continue
      string.join(line.rstrip('\n')) 
  </code></pre>
  
  <p>The output of this code is as follows:</p>
  
  <p>abc</p>
  
  <p>def</p>
  
  <p>ghi</p>
  
  <p>Is there a way to join these physical lines into one logical line, e.g:</p>
  
  <p>abcdefghi</p>
  
  <p>Basically, how can I concatenate multiple strings into one large string? </p>
  
  <p>If I was reading from a file with very long strings is there the risk of an overflow by concatenating multiple physical lines into one logical line?</p>