If I want to split a list of words separated by a delimiter character, I can use
>>> \'abc,foo,bar\'.split(\',\')
[\'abc\', \'foo\', \'bar\']
The CSV module should be able to do that for you
import csv
input = ['abc,"a string, with a comma","another, one"']
parser = csv.reader(input)
for fields in parser:
for i,f in enumerate(fields):
print i,f # in Python 3 and up, print is a function; use: print(i,f)
Result:
0 abc 1 a string, with a comma 2 another, one