shutil.rmtree(<path>) <spanclass="hljs-comment"># Deletes the entire directory tree.</span>
</code></pre>
<pre><codeclass="python language-python hljs">os.rename(<spanclass="hljs-keyword">from</span>, to) <spanclass="hljs-comment"># Renames the file or directory.</span>
os.replace(<spanclass="hljs-keyword">from</span>, to) <spanclass="hljs-comment"># Same, but overwrites 'to' if it exists.</span>
<pre><codeclass="python language-python hljs">os.rename(from, to) <spanclass="hljs-comment"># Renames the file or directory.</span>
os.replace(from, to) <spanclass="hljs-comment"># Same, but overwrites 'to' if it exists.</span>
</code></pre>
<pre><codeclass="python language-python hljs">os.mkdir(<path>, mode=<spanclass="hljs-number">0o777</span>) <spanclass="hljs-comment"># Creates a directory.</span>
<iter> = os.scandir(path=<spanclass="hljs-string">'.'</span>) <spanclass="hljs-comment"># Returns os.DirEntry objects located at path.</span>