how to search multiple textfiles ? (Python is slow ?)
enleverlesX.XmcX at XmclaveauX.com
Sat Sep 27 08:59:20 CEST 2008
Thanks for return.
Some infos: from a long time, I found that it's often more fast to use
windows's command, instead of develop in high level language (and also,
FINDSTR is fast. OK. But internal commands are more fast. Example : DIR
(with all his options)
And it's faster to read the result via a Pipe.
Thus, I use frequently this sort of function:
def cmdone(repstart, commande, moderetour="LIST"):
if moderetour.upper() == "STR":
print cmdone('D:\\dev\\python','findstr /N /I ponx *.py','STR')
print cmdone('D:\\dev\\python','dir *.jpg /B')
Sorry for my bad english, and have a good day...
More information about the Python-list