Q:

try to split the row of a csv output

Now I am writing some data into a csv file. I directly write a list to a row of a csv file, like below:
with open("files/data.csv", "wb") as f_csv:
    writer = csv.writer(f_csv,delimiter = ',')
    writer.writerow(flux_inteplt)        ## here flux_inteplt is a list

But when I read the data like below:
with open('files/data.csv','rb') as csvfile:
    reader = csv.reader(csvfile, delimiter=' ')
    for row in reader:
        parts = row.split(",")
        print parts[0]

It has some problem AttributeError: 'list' object has no attribute 'split'
Does anyone has some idea how to approach to this problem?

A:

import csv
with open('us-cities.csv','rb') as csvfile:
reader = csv.reader(csvfile, delimiter=' ')
for row in reader:
    str1 = ''.join(row) #Convert list into string
    parts = str1.split(",")
    print parts[0]

