Can python read up to where a certain pattern is matched?

Cameron Laird claird at lairds.com
Sun Mar 14 13:49:38 EST 2004


In article <c2e37t$1rsg2r$1 at ID-99293.news.uni-berlin.de>,
William Park  <opengeometry at yahoo.ca> wrote:
>Anthony Liu <antonyliu2002 at yahoo.com> wrote:
>> I am kinda new to Python, but not new to programming. 
>> I am a certified Java programmer.
>> 
>> I don't want to read line after line, neither do I
>> want to read the whole file all at once.  Thus none of
>> read(), readline(), readlines() is what I want. I want
>> to read a text file sentence by sentence. 
>
>Question: How do I read sentence by sentence?
>Answer: Read input stream char by char.
			.
			.
			.
I thought it was idiomatic to specify which *kind* of
certification a Java programmer holds.

The answers in this thread have been all over the map.
My interpretation of the original question has it that
William's answer is the only legitimate one--but maybe
the original poster intended something different from
what I read, and likes all those alternatives.

Anyway, the one fundamentally different perspective on
this question I haven't seen anyone mention is what
Pexpect <URL: http://pexpect.sf.net > gives.  From a
Java background, this might come as a revelation--or 
be incomprehensible.
-- 

Cameron Laird <claird at phaseit.net>
Business:  http://www.Phaseit.net



More information about the Python-list mailing list