On May 22, 2005, at 21:07, Jonas Melian wrote:

> for line in fileinput.input(glob.glob(os.path.join
>         (dir_locales, "*_[A-Z][A-Z]"))):
>     if re.search("locale for", line):
>         print line

     If you're only looking for the occurrence of a string and not a  
regex pattern, you don't have to use regular expressions:


if "locale for" in line:
     print line


     Works just as well, and is faster.

-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting  
and sweating as you run through my corridors... How can you challenge  
a perfect, immortal machine?"

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to