title: How to make sure a directory is always constructed the same way in Python?
body: <p>I'm trying to write a python script that does a lot of tedious file handling for me.
  To make sure nothing can go wrong I wanted to create the file structure I need from scratch everytime.
  Wondering if there is an easier way to do this...</p>
  <pre><code>if os.path.exists(pth_temp_data) == 1:
      shutil.rmtree(pth_temp_data.joinpath(&quot;Presets/Factory_Presets/Global_Presets&quot;))
      shutil.rmtree(pth_temp_data.joinpath(&quot;Presets/Factory_Presets&quot;))
      shutil.rmtree(pth_temp_data.joinpath(&quot;Presets&quot;))
      shutil.rmtree(pth_temp_data)
      os.makedirs(pth_temp_presets)
  else:
      os.makedirs(pth_temp_presets)
  </code></pre>