On Thu, Jan 20, 2011 at 9:32 PM, walter weston <[email protected]>wrote:

>  I have a question I know the shutil module deletes directories, If I use
> this code will it delete all of my program files?
>
> import shutil
> shutil.rmtree('C:\Program Files (x86)')
>


Assuming you have the proper permissions, yes.

An easy and safe(ish) way to test this would be to create a directory and
populate it with subdirectories and files, then try calling rmtree() on that
directory. Of course it's also safer to use forward slashes in your
directory. For instance, if you had rmtree('C:\test'), it will try to remove
the directory that has a tab character in it.

HTH,
Wayne
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to