Removing a directory using shutil module
<p>I'm trying to remove a directory using python but I do not want to recursively remove the whole directory path in the process: i.e</p>

<p>/home/dir/dir/dirtoberemoved</p>

<p>So I don't want to remove anything at a higher level just the one directory and all its contents. I've been looking on stackoverflow to research this question and most answers have included using the shutil module which I am unfamiliar with, looking at the python documentation for the module it says 'Delete an entire directory tree'</p>

<p>If I do something like this:</p>

<pre><code>    if os.path.exists("/home/dir/dir/dirtoberemoved");

        shutil.rmtree("/home/dir/dir/dirtoberemoved");
</code></pre>

<p>or         </p>

<pre><code>         shutil.rmtree("/dirtoberemoved");
</code></pre>

<p>Will the entire path be removed? If so is there any good way just to delete one non-empty directory in python without deleting higher level directories?</p>
