delete file

lamar_air lamar_air at hotmail.com
Fri Jul 11 15:29:30 CEST 2003


Peter Hansen <peter at engcorp.com> wrote in message news:<3F0D962E.23DA9F59 at engcorp.com>...
> "Bartolomé Sintes Marco" wrote:
> > 
> > I have a program that unzip some zip files. After unzipping them,
> > I want to delete the zip files with os.remove, but I get this error:
> > OSError: [Errno 13] Permission denied: ....
> 
> Close the files properly after unzipping them, perhaps?  If that
> doesn't help, please specify operating system, and give details
> on how you are unzipping.  Is it using Python's zipfile module,
> or some other method, and exactly how do you do it?
> 
> -Peter

I want to be able to delete a file on my C: drive through my python
script.  My script writes a file. So i want to delete the file if it
already exists then write it.  What's the best way to do this?




More information about the Python-list mailing list