First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked Jun 20 '12

Don gravatar image

CSV Reader

Hope you are keeping well. Thank you very much for the Python course. I still need to find time to through every module once again.

I have been playing with the “csv.reader” command 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 “ )”

I have attached both the script and csv files

click to hide/show revision 2
Edited the email context and formatted the code.

updated Jun 20 '12

JervisW gravatar image

CSV Reader

Hope you are keeping well. Thank you very much for the Python course. I still need to find time to through every module once again.

I have been playing with the “csv.reader” command 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 “ )”

I have attached both the script and csv files