Remove diretory with files in it

samuel Parkay sap at eibnet.com
Sun Aug 25 07:17:36 CEST 2002


On Sat, 24 Aug 2002 23:38:56 -0400 (EDT), Vasisht Tadigotla
<vasisht at eden.rutgers.edu> wrote:

>
>
>or you can use the rmtree() function in shutil module. this removes the
>directory even there are files present in it.
>
>
>On 24 Aug 2002, Paul Rubin wrote:
>
>> samuel Parkay <sap at eibnet.com> writes:
>> > I can;'t  seem to make the os.rmdir()path) command to work the way I
>> > need it .  I would like it to be like" rm -rf" in unix .  It keeps
>> > throwing an exception about not being empty.  Is there a way to rmove
>> > a directory and it's contents in python?
>> 
>> You have to remove all the contents before you can rmdir a directory.
>> Using os.system("rm -rf directory") is probably the simplest.
>> 
>> -- 
>> http://mail.python.org/mailman/listinfo/python-list
>> 
>
>---------------------------------------------------------------------
>ce .sig n'est pas une .sig
>
>
Thank you just what I needed







More information about the Python-list mailing list