title: how to check if folder exist and create folder using python
body: <p>How to check if folder exist and create it if it doesn't?</p>
  <pre><code>import os
  from datetime import datetime
  
  file_path = &quot;F:/TEST--&quot;
  if os.path.exists(file_path):
      os.rmdir(file_path)
      os.makedirs(file_path + datetime.now().strftime('%Y-%m-%d'))
  else:
      os.makedirs(file_path + datetime.now().strftime('%Y-%m-%d'))
  </code></pre>