readline()

Dana Booth dana at mmi.oz.net
Wed Mar 22 14:55:11 EST 2000


I have a small proggie that reads through the mailspool, looking for lines
containing keywords. If the mailbox contains mime encoded attachements, or
for some other reason is very large, it seems to take quite a long time. The
util uses readline() and the re.search.

Is readline() not very efficiant? I know that Perl is really the ticket for
most text processing utils that require anything more than Awk, and in
this case it's much faster, but the Python util goes on to do much more, and
I didn't want to call on Perl just for a textfile read.

Anyway, I'm pretty new to Python, is there a better way to analyze
textfiles? Or is the re.search slowing it down?

-- 
-----
Dana Booth <dana at mmi.oz.net>
Tacoma, Wa., USA

key at pgpkeys.mit.edu:11371



More information about the Python-list mailing list