Rich Shepard wrote:
On Tue, 22 Nov 2011, Ethan Furman wrote:

reader = csv.reader(open("test.txt","r"),
                   delimiter="|",
                   quotechar="'")
output = csv.writer(open("out.txt","w"),
                   delimiter="|",
                   quotechar="'")

Ethan,

  How are these opened files closed? csv.reader() and csv.writer() have no
close method.

Rich


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.

~Ethan~
_______________________________________________
Portland mailing list
[email protected]
http://mail.python.org/mailman/listinfo/portland

Reply via email to