for loops in python
<p>Is there a pythonic way (I know I can loop using range(len(..)) and get an index) to do the following example:</p>

<pre><code>for line in list_of_strings:
    if line[0] == '$':
        while line[-1] == '#':
            # read in the Next line and do stuff
        # after quitting out of the while loop, the next iteration of the for loop
        # should not get any of the lines that the while loop already dealt with
</code></pre>

<p>essentially, the nested while loop should be incrementing the for loop.</p>

<p><strong>Edit:</strong> Not a file handle, confused two things I was working on, it's a list of strings</p>
