title: Writing a string to a file goes to the wrong spot
body: <p>I have a python script that takes a csv file and adds a string to it. The only issue is the string that I add is at the end of the string. I would like it to be in the front of the string instead of the end.</p>
  <p>Here is the script:</p>
  <pre><code>#Adding string to the front of each line for the Part Numbers
  string_to_add = r&quot;V:\DATABASES\0 Suspension\Suspensia Pictures\ &quot;
  
  #Open the file and join the .JPG to the current lines
  with open(&quot;PartNumbers.csv&quot;, 'r') as f:
      file_lines = [''.join([x.strip(), string_to_add,'\n']) for x in f.readlines()]
  
  with open(&quot;PartNumbers.csv&quot;, 'w') as f:
      f.writelines(file_lines)
  </code></pre>
  <p>It gives me this output:</p>
  <pre><code>X00TB0001V:\DATABASES\0 Suspension\Suspensia Pictures\ 
  X01BJ0003V:\DATABASES\0 Suspension\Suspensia Pictures\ 
  X01BJ0004V:\DATABASES\0 Suspension\Suspensia Pictures\ 
  X01BJ0005V:\DATABASES\0 Suspension\Suspensia Pictures\ 
  X01BJ0006V:\DATABASES\0 Suspension\Suspensia Pictures\ 
  X01BJ0007V:\DATABASES\0 Suspension\Suspensia Pictures\ 
  X01BJ0008V:\DATABASES\0 Suspension\Suspensia Pictures\ 
  </code></pre>
  <p>This is the output I am looking for:</p>
  <pre><code>V:\DATABASES\0 Suspension\Suspensia Pictures\ X00TB0001
  V:\DATABASES\0 Suspension\Suspensia Pictures\ X01BJ0003
  V:\DATABASES\0 Suspension\Suspensia Pictures\ X01BJ0004
  V:\DATABASES\0 Suspension\Suspensia Pictures\ X01BJ0005
  V:\DATABASES\0 Suspension\Suspensia Pictures\ X01BJ0006
  V:\DATABASES\0 Suspension\Suspensia Pictures\ X01BJ0007
  V:\DATABASES\0 Suspension\Suspensia Pictures\ X01BJ0008
  </code></pre>
  <p>My original idea was to change around the line</p>
  <pre><code>file_lines = [''.join([x.strip(), string_to_add,'\n']) for x in f.readlines()]
  </code></pre>
  <p>to this:</p>
  <pre><code>file_lines = [ string_to_add,''.join([x.strip(),'\n']) for x in f.readlines()]
  </code></pre>
  <p>When I do that I get this error:</p>
  <pre><code>file_lines = [string_to_add,''.join([x.strip(), '\n']) for x in f.readlines()]
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  SyntaxError: did you forget parentheses around the comprehension target?
  </code></pre>
  <p>How can I edit this script to get the desired output?</p>