> You don't need "for fn in open_files.keys():", you can just use "for fn in
> open_files:", but simpler than that is to just use the dictionary values:
> 
> for fn in open_files.values():
>     fn.close()

This can also work for standard variable names:

   for f in (messages, deliveries, actions, parts,
       recipients, viruses, esp_scores):
     f.close()

-tkc


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

Reply via email to