Jonas Melian wrote:
> any improvement about this code?
> how print the actual file?

You can print the file name and line number using fileinput.filename() and 
fileinput.filelineno()

> could i add an exception? by if there aren't files

Set a flag if you print anything, check it at the end of the loop

Kent
> 
> 
> for line in fileinput.input(glob.glob(os.path.join
>         (dir_locales, "*_[A-Z][A-Z]"))):
>     if re.search("locale for", line):
>         print line
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
> 

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

Reply via email to