I have a csv file with say 3 rows like this:
Dallas
Houston
Ft. Worth
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:
<a href="/dallas/">Dallas</a> <a href="/houston/">Houston</a> <a href="/ft-worth/">Ft. Worth</a>
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.
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()