newbie permission problem

Ann Anna at nospam.invalid
Sun Oct 3 19:17:15 EDT 2004


"Peter L Hansen" <peter at engcorp.com> wrote in message
news:fu-dnWwayaoxGv3cRVn-qg at powergate.ca...
> 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"?

Probably cuz I'm new to python and I saw an example in
the documentation that did it without fp. As you say,
fp makes more sense and I am using it now.





More information about the Python-list mailing list