Andrea Tomadin wrote: > I run a program which does some logging on files. I want to collect > all the filenames and handlers in the same structure. All the files > should be opened at startup, closed at exit, and easily accessed by > the rest of the script.
open them at the module level, and close them in an "atexit" handler (or if they're plain files, leave the closing to the garbage collector). </F> -- http://mail.python.org/mailman/listinfo/python-list