I am trying to write a list in csv, however, when I do this, I get shell quotes around the values of my field:
number1,number2 "1234,2345" "1235.7890" "2345.5687"
Using this code:
with open('C:\\temp\\test.csv', 'wb') as out_file: ... csv_writer = csv.writer(out_file, delimiter=',') ... csv_writer.writerow(('number1','number2')) ... for f in myList: ... csv_writer.writerow(f)
After further research, I found that you can delete the quotation mark using:
quotechar = '', quoting = csv.QUOTE_NONE **
When I apply this to my code, I get this error:
Traceback (last last call): File "", line 4, in Error: need to run, but no escapechar set
with open('C:\\temp\\test.csv', 'wb') as out_file: ... csv_writer = csv.writer(out_file, delimiter=',',quotechar='', quoting=csv.QUOTE_NONE) csv_writer.writerow(('number1','number2')) ... for f in myList: ... csv_writer.writerow(f)
How to remove these quotes?
Edit
myList looks like this:
[['1234,2345'], ['1235,7890'], ['2345,5687']]