CSV Reader
I have been playing with the csv.reader
module in reading a column in the following format.
[‘filename1’,
‘filename2’,
………..
]
However, I end up with getting an extra-bracket which I don’t want
[ ( ‘filename1’,
‘filename2’,
………….)
]
Just wondering whether you want to suggest me a pythonic way of getting rid of the “ ( “ and “ )”
Good question
Can you share a bit more information? csv.reader.next() returns a list of values each row like [col1, col2, col3]. I'm not sure how you're getting [ (col1, col2, col3) ]
@chip. If you do something like list(reader) it will create a list of tuples, rather than returning a single row. I suspect that is what is going on here.