[Tutor] regular expression problem

Spencer Parker inthefridge at gmail.com
Wed Apr 15 18:59:34 CEST 2009


After he said that...I realized where I was being dumb...

On Wed, Apr 15, 2009 at 10:29 AM, bob gailer <bgailer at gmail.com> wrote:

> Spencer Parker wrote:
>
>> I have a python script that takes a text file as an argument.  It then
>> loops
>> through the text file pulling out specific lines of text that I want.  I
>> have a regular expression that evaluates the text to see if it matches a
>>
>> specific phrase.  Right now I have it writing to another text file that
>> output.  The problem I am having is that it finds the phrase prints it,
>> but
>> then it continuously prints the statement.  There is only 1 entries in the
>>
>> file for the result it finds, but it prints it multiple times...several
>> hundred before it moves onto the next one.  But it appends the first one
>> to
>> the next entry...and does this till it finds everything.
>>
>> http://dpaste.com/33982/
>>
>>
>> Any Help?
>>
>>
>
> dedent the 2nd for loop.
>
> --
> Bob Gailer
> Chapel Hill NC
> 919-636-4239
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090415/d1455fe7/attachment-0001.htm>


More information about the Tutor mailing list