added credit

This commit is contained in:
Guillaume Redoulès 2018-09-15 08:14:03 +02:00
parent 7222f1da96
commit 5afcfbd44a
3 changed files with 3 additions and 3 deletions

View File

@ -143,7 +143,7 @@
</pre></div>
<p>copy the ensure_dir function in your code. This function will handle the creation of the directory</p>
<p>copy the ensure_dir function in your code. This function will handle the creation of the directory. Credit goes to <a href="https://stackoverflow.com/questions/273192/how-can-i-safely-create-a-nested-directory-in-python">Parand</a> posted on StackOverflow</p>
<div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">ensure_dir</span><span class="p">(</span><span class="n">file_path</span><span class="p">):</span>
<span class="n">directory</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">file_path</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">directory</span><span class="p">):</span>

View File

@ -5,7 +5,7 @@ xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>redoules.github.io/</loc>
<lastmod>2018-09-15T08:07:45-00:00</lastmod>
<lastmod>2018-09-15T08:13:37-00:00</lastmod>
<changefreq>daily</changefreq>
<priority>0.5</priority>
</url>

File diff suppressed because one or more lines are too long