Next / Previous / Contents / Shipman's homepage

7.5. commaSeparatedList: Parser for a comma-separated list

The variable pp.commaSeparatedList is a parser that matches any text, and breaks it into pieces wherever there is a comma (“,”).

>>> print pp.commaSeparatedList.parseString('spam, spam, spam, and spam')
['spam', 'spam', 'spam', 'and spam']