Feb-10-2019, 09:17 AM
I would definitely use csv module, but if you insist on your approach, at least use ast.literal_eval()
>>>import ast >>> line = '[1, "some text, with comma", "1,000.5"]' >>> ast.literal_eval(line) [1, 'some text, with comma', '1,000.5']
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs