title: Create path and filename from string in Python
body: <p>Given the following strings:</p>
  
  <pre><code>dir/dir2/dir3/dir3/file.txt
  dir/dir2/dir3/file.txt
  example/directory/path/file.txt
  </code></pre>
  
  <p>I am looking to create the correct directories and blank files within those directories. </p>
  
  <p>I imported the <code>os</code> module and I saw that there is a <code>mkdir</code> function, but I am not sure what to do to create the whole path and blank files. Any help would be appreciated. Thank you.</p>