Group: comp.lang.python


Subject: File to dict
From: Neil Cerutti
Date: 12/7/2007 2:36:07 PM
On 2007-12-07, Duncan Booth <duncan.booth@invalid.invalid> wrote: > from __future__ import with_statement > > def loaddomainowners(domain): > with open('/etc/virtual/domainowners','r') as infile: I've been thinking I have to use contextlib.closing for auto-closing files. Is that not so? -- Neil Cerutti