CSV writer question

Chris Angelico rosuav at gmail.com
Mon Oct 24 03:03:15 EDT 2011


On Mon, Oct 24, 2011 at 4:18 PM, Jason Swails <jason.swails at gmail.com> wrote:
> my_csv = csv.writer(open('temp.1.csv', 'wb'))
>

Have you confirmed, or can you confirm, whether or not the file gets
closed automatically when the writer gets destructed? If so, all you
need to do is:

my_csv = something_else
# or:
del my_csv

to unbind what I assume is the only reference to the csv.writer, upon
which it should promptly clean itself up.

ChrisA



More information about the Python-list mailing list