newbie permission problem

Ann Anna at nospam.invalid
Mon Oct 4 01:17:15 CEST 2004

"Peter L Hansen" <peter at> wrote in message
news:fu-dnWwayaoxGv3cRVn-qg at
> 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 =
> >
> > then I can close fp and delete the file.
> >
> > How can I just use
> > im ="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