En Thu, 28 Feb 2008 12:33:33 -0200, <[EMAIL PROTECTED]> escribi�: > Implemented all your suggestions, with two exceptions. > > Changed file read to readlines(), but not open(...).readlines(). I > love to say file.close(). Gives me a feeling of security. (We could > discuss RAM waste v. I/O speed but this input file is just 10KB, so > neither matters.)
Ok, what about this? with open(...) as f: for line in f: ...do something with each line... The with statement guarantees that close (implicit) is always called. > Removed one of the three globals, but left the other two. Couldn't see > any real advantage to passing poor 'ofile' from hand to hand > (writeHTML() to writeBody() to writeEntries() ...) as opposed to > letting him rest easy in his chair, doing a little writing when > called. Perhaps not in this small script, but as a design principle, having a global `ofile` object doesn't look good... > Also changed the opening doc comment to give you appropriate credit. No need for that. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list