title: Python readlines() and append data to each line output to one line
body: <p>I have a csv file with say 3 rows like this:</p>
  
  <pre><code>Dallas
  Houston
  Ft. Worth
  </code></pre>
  
  <p>What I want to do is be able to read those in and make links out of them but have all the lines output on one line. Example output would need to be like this:</p>
  
  <pre><code>&lt;a href="/dallas/"&gt;Dallas&lt;/a&gt; &lt;a href="/houston/"&gt;Houston&lt;/a&gt; &lt;a href="/ft-worth/"&gt;Ft. Worth&lt;/a&gt;
  </code></pre>
  
  <p>Here is the code I have thus far and it reads the csv file and outputs but it creates different rows, and I only want one row plus I need to append the html code for hyper links in.</p>
  
  <pre><code>f_in = open("data_files/states/major_cities.csv",'r')
  for line in f_in.readlines():
      f_out.write(line.split(",")[0]+"")
  f_in.close()
  f_out.close()
  </code></pre>