title: How to remove a directory? Is os.removedirs and os.rmdir only used to delete empty directories?
body: <p>Whenever I try to use them to remove dirs with things in them I get this error message</p>
  
  <pre><code>import os
  os.chdir('/Users/mustafa/Desktop')
  os.makedirs('new-file/sub-file')
  os.removedirs('new-file') 
  </code></pre>
  
  <blockquote>
    <p>"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 170, in removedirs
        rmdir(name)
    OSError: [Errno 66] Directory not empty: 'new-file'</p>
  </blockquote>
  
  <p>However I think I saw people using those commands to delete dirs that weren't empty, so what am I doing wrong? Thanks</p>