On Tue, May 6, 2008 at 1:42 PM, Anton Slesarev <[EMAIL PROTECTED]> wrote:
>  Is it possible to increase file reading performance?

Dunno about that, but this part:

>  flines = (line for line in f if pat.search(line))
>  c=0
>  for x in flines:
>     c+=1
>  print c

could be rewritten as just:

print sum(1 for line in f if pat.search(line))
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to