[FEEDBACK] Is this script efficient...is there a better way?
Bob X
bobx at linuxmail.org
Thu Sep 12 17:07:44 EDT 2002
Steve Holden wrote:
> "Bob X" <bobx at linuxmail.org> wrote ...
> [ ... ]
>
>>Thank you very much...your shorter script did work. The keywords are all
>>"normal" english words that would not have any special characters. I
>>only added a re.IGNORECASE (since case doesn't matter to me) after a
>>quick search of the python docs.
>>
>
> Was there any significant difference in the timings for the two different
> methods, and how does the number of different keywords affect the timings?
>
I haven't tested...is there an easy way to time it...besides my going
"that one ran faster"?
However, I had a chance to run your RE version today and it did very
well. BTW..the line that looked like a debug statement was just a visual
for me to see the script was actually doing something. I put in a
counter that prints "lines written:", a where "a" is the counter. I do
have one question on that. It writes each line sequentially like:
lines written: 1
lines written: 2
lines written: 3
Can I just get it to do it in place? Where the numbers are just replaced
instead of scrolling? Just a thought...
Bob
Bob
More information about the Python-list
mailing list