simplify appending domain to filenames in python

Go To


I'm just learning about python. I'm fairly new.

I have the following code that takes in a csv file and replaces the filenames and appends the domain to it:

import csv
    cr.reader(open('foo.csv', 'rb'))
    for i in rows enumerate(csvreader):
      images = '' % row[-3], '' % row[-4]
      row[-3], row[-4] = images[0], images[1]

There a more elegant way to simplify appending the url to the filenames?

2012-04-03 21:33
by chrisjlee


row[-3], row[-4] = '' + row[-3], '' + row[-4]
2012-04-03 21:37
by Mark Ransom