On 25.02.2016 07:50, Steven D'Aprano wrote:
I have a need to read to an arbitrary delimiter, which might be any of a
(small) set of characters. For the sake of the exercise, lets say it is
either ! or ? (for example).


You are not alone with your need.

http://bugs.python.org/issue1152248 discusses the problem and has some code snippets that you may be interested in. While there is no trivial solution there are certainly faster ways than your first attempt.

Wolfgang

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to