Re: low-level csv

2019-11-17 Thread Greg Ewing
On 18/11/19 9:30 am, Dave Cinege wrote: The few times I looked at CSV module it never looked useful to me. I seem to use shlex for everything. For example: def csv_split (s): lex = shlex.shlex(s, posix=True) lex.whitespace_split = True lex.whitespace = ',' return list(lex)

Re: low-level csv

2019-11-17 Thread Dave Cinege
The few times I looked at CSV module it never looked useful to me. I seem to use shlex for everything. For example: def csv_split (s): lex = shlex.shlex(s, posix=True) lex.whitespace_split = True lex.whitespace = ',' return list(lex) will split on commas while

Re: low-level csv

2019-11-17 Thread Skip Montanaro
On Sun, Nov 17, 2019 at 7:23 AM Antoon Pardon wrote: > > This is python 2.6->2.7 and 3.5->3.7 > > I need to convert a string that is a csv line to a list and vice versa. > I thought to find functions doing this in the csv module but that doesn't > seem to be the case. Take a look at the test

Re: low-level csv

2019-11-17 Thread Dan Sommers
On 11/17/19 7:18 AM, Antoon Pardon wrote: This is python 2.6->2.7 and 3.5->3.7 I need to convert a string that is a csv line to a list and vice versa. I thought to find functions doing this in the csv module but that doesn't seem to be the case. I can of course write special classes that would

low-level csv

2019-11-17 Thread Antoon Pardon
This is python 2.6->2.7 and 3.5->3.7 I need to convert a string that is a csv line to a list and vice versa. I thought to find functions doing this in the csv module but that doesn't seem to be the case. I can of course write special classes that would allow for this using a csv.reader and