[Tutor] Iterating through objects

bob gailer bgailer at gmail.com
Sun Aug 16 20:12:20 CEST 2009


GoodPotatoes wrote:
> I'm not sure if I've been searching using the correct terms.  After 
> I've iterated through an object, such as a cursor or webpage, how do I 
> get back to the "top"?
>
> e.g.
>
> tutorial from http://www.daniweb.com/code/snippet563.html#
>
> print page1.readlines()
Capture the lines in a variable.

foo = page1.readlines()
print foo

>
> From this excercise, the first time I read page1 I get all of the 
> lines.  The next time, I only get []. What happens to all of the info 
> after I've read it?
>
> Do I need to again get the info from the web?
> page1 = opener1.open(picture_page)
> *
> *
> *
> *
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor




More information about the Tutor mailing list