title: Python: create a directory with 777 permissions
body: <p>I'm making a program that creates a folder using <code>os.makedirs("foo")</code>.
  But when I open Windows 10 files explorer and right click on the new directory that has been created, I noticed that it was not possible to delete the folder without administrator privileges.
  So how do you create a folder with the permission to recursively delete this folder ?</p>
  
  <p>I create the directory using: <code>os.makedirs("data/base/{}".format(args[0].text), mode=0o777)</code></p>
  
  <p>I delete it using:</p>
  
  <pre><code>def delete_class(self, *args):
          for root, dirs, files in os.walk("data/base/{}".format(self.clicked_class_to_delete.id), topdown=False):
              for name in files:
                  filename = os.path.join(root, name)
                  os.chmod(filename, stat.S_IWUSR)
                  os.remove(filename)
              for name in dirs:
                  os.rmdir(os.path.join(root, name))
          shutil.rmtree("data/base/{}".format(self.clicked_class_to_delete.id)
  </code></pre>
  
  <p>)</p>