[portland] Not Seeing Script Error(s)
ethan at stoneleaf.us
Tue Nov 22 22:53:25 CET 2011
Rich Shepard wrote:
> On Tue, 22 Nov 2011, Ethan Furman wrote:
>> reader = csv.reader(open("test.txt","r"),
>> output = csv.writer(open("out.txt","w"),
> How are these opened files closed? csv.reader() and csv.writer() have no
> close method.
They are closed automatically. It's not good practice to do this way,
though -- better would be to assign the open files to their own name,
then you could 'name.close()' when you were done.
More information about the Portland