Looping [was Re: Python and the need for speed]

Paul Rubin no.email at nospam.invalid
Mon Apr 17 20:23:14 EDT 2017


Ben Bacarisse <ben.usenet at bsb.me.uk> writes:
>   c = sys.stdin.read(1)
>   while c == ' ':
>       c = sys.stdin.read(1)

c = itertools.dropwhile(
     lambda c: c==' ',
     iter(lambda: sys.stdin.read(1),None)
     ).next()


More information about the Python-list mailing list