[Tutor] search/match file position q

Clayton Kirkwood crk at godblessthe.us
Tue Oct 7 01:55:02 CEST 2014


Howdy

I haven't been able to find an definitive answer. I am looking through a
file(stream:<), for several matching strings. Match definitively starts at
the beginning of the stream. As I search, or match, do I start over at the
beginning of the stream for each match or do I start at the end of the last
search/match? Apparently the file object knows where it is in a stream, but
it is unclear whether line_location = readline() keeps track of that
location. I see advantages to both protocols, but overall, I would prefer
that the next search starts at the end of the last start

 

TIA,

 

Clayton

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20141006/6999b8be/attachment.html>


More information about the Tutor mailing list