I have a list of pathnames:
li = [u"C:\\temp\\fileA.shp", u"C:\\temp\\fileB.shp", u"C:\\temp\\fileC.shp"]
I am trying to write each path on a separate line in a txt file. This is what I have done so far:
import csv
li = [u"C:\\temp\\fileA.shp", u"C:\\temp\\fileB.shp", u"C:\\temp\\fileC.shp"]
with open(r'C:\temp\myfile.csv', "wb") as f:
wr = csv.writer(f, delimiter=',', quoting=csv.QUOTE_NONE)
wr.writerows([li])
Which yields a list of files on the same row:
C:\temp\fileA.shp,C:\temp\fileB.shp,C:\temp\fileC.shp
How can I tweak this so that the pathnames are each on their own row? The following is what I am after:
C:\temp\fileA.shp
C:\temp\fileB.shp
C:\temp\fileC.shp