> > I don't know of a way to open a closed file object, you might want
> > to store the filename along with the file. Then if you discover it is
> > closed you can use the name to reopen it.
>
>You could probably just open it again, with:
>
> f = open(f.name, f.mode)

Ah, good point. I had forgotten that the file object had a name 
attribute so yes that should work.

Although personally I'd probably go with the custom fileobject 
approach just for the improved readability.

Alan G.
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to