How to delete everything inside a certain folder

and how do I make the program detect this exception?

If I learn advanced python can I find this out easily?

Some things are just kinda Microsoft Windows breakage.

You probably could do pretty well with a for loop on glob.glob and rmtree’ing each thing you get back from glob.glob.

But if the OS kernel refuses to allow you to remove files that are in use, there’s not a lot Python programs can do, unless you want to schedule a reboot and remove the files upon coming back up, or killing the processes that have the files open.

If you were on a *ix, like Linux or MacOS, it’d probably be easy. Mac does have problems stat’ing some files, but not as bad as Microsoft Windows.