how to search multiple textfiles ? (Python is slow ?)

Stef Mientki stef.mientki at
Mon Sep 29 21:56:19 CEST 2008

Lawrence D'Oliveiro wrote:
> In message <mailman.1566.1222464403.3487.python-list at>, Stef
> Mientki wrote:
>> - Pyscripter 110 sec ( PyScripter is the default IDE I use now)
>> - Delphi  20 .. 35 sec
>> - Findstr  4 sec
> What order did you try try them in? Did you try each one more than once, in
> different orders? Just to rule out filesystem caching effects.
I repeated all of them at least twice, to see if I got the same result.
And indeed the very first run (PyScripter)  was about 150 sec.
So I think the above mentioned values give a good impression, nothing more.
>> I'm really amazed by the speed of Python !!
>> It can only be beaten by findstr, which is only available on windows.
> Did you try find -exec grep -F?
well my windows version doesn't understand that :

P:\Python>find /?
Searches for a text string in a file or files.

FIND [/V] [/C] [/N] [/I] [/OFF[LINE]] "string" [[drive:][path]filename[ 

  /V         Displays all lines NOT containing the specified string.
  /C         Displays only the count of lines containing the string.
  /N         Displays line numbers with the displayed lines.
  /I         Ignores the case of characters when searching for the string.
  /OFF[LINE] Do not skip files with offline attribute set.
  "string"   Specifies the text string to find.
             Specifies a file or files to search.

If a path is not specified, FIND searches the text typed at the prompt
or piped from another command.


> --

More information about the Python-list mailing list