Thank-you (Re: Iterate through a single iterator from multiple places in a loop)

2010-09-21 Thread python
MRAB, > it = iter(some_long_string) Well, that was easy! :) Thanks for your help. Malcolm - Original message - From: "MRAB" To: python-list@python.org Date: Wed, 22 Sep 2010 00:27:25 +0100 Subject: Re: Iterate through a single iterator from multiple places in a loop

Re: Iterate through a single iterator from multiple places in a loop

2010-09-21 Thread MRAB
On 22/09/2010 00:10, pyt...@bdurham.com wrote: Is there a pythonic way to loop through a single iterator from > multiple places in a loop? Here's pseudo code for what I would like to do: for char in some_long_string: if char == some_char: for char in some_long_string: <--- using s

Iterate through a single iterator from multiple places in a loop

2010-09-21 Thread python
Is there a pythonic way to loop through a single iterator from multiple places in a loop? Here's pseudo code for what I would like to do: for char in some_long_string: if char == some_char: for char in some_long_string: <--- using same iterator as above # continue to pull