newbie permission problem

Peter L Hansen peter at engcorp.com
Sun Oct 3 19:13:48 EDT 2004


Ann wrote:
> I found the problem just now, the file is still open when I tried
> to delete it. If I use
> 
> fp = open("filename.jpg", "rb")
> im = Image.open(fp)
> 
> then I can close fp and delete the file.
> 
> How can I just use
> im = Image.open("filename.jpg")
> without having to use a fp

I would ask why you would want to do it without using
an "fp".  The fp solution is more readable (to another
programmer, that is), more portable, and besides, it
works, so why look for a possibly more complicated
alternative just to avoid using "fp"?



More information about the Python-list mailing list