Hi !

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, low level...)

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:


import os

def cmdone(repstart, commande, moderetour="LIST"):
   os.chdir(repstart)
   sret=''.join(os.popen(commande))
   if moderetour.upper() == "STR":
       return sret
   else:
       return sret.split('\n')

print cmdone('D:\\dev\\python','findstr /N /I ponx *.py','STR')
print
print cmdone('D:\\dev\\python','dir *.jpg /B')




Sorry for my bad english, and have a good day...
--
Michel Claveau


--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to