<div class="gmail_quote">On 14 February 2012 09:59, Wanderer <span dir="ltr"><<a href="mailto:wanderer@dialup4less.com">wanderer@dialup4less.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I think wanting to create a directory if one doesn't exist or do<br>
nothing if it does exist and just use the existing directory is a<br>
fairly normal programming need. Apparently this is somewhat<br>
complicated in Python.<br>
...<br>
IMHO, os.makedirs should do this for you with something like<br>
<br>
os.makedirs(dirName, exist = False)<br>
<br>
and have makedirs silence the error the 'right' way whatever that is,<br>
without turning it into an exercise for the user.</blockquote><div><br></div><div>Added in 3.2: <a href="http://docs.python.org/py3k/library/os.html?highlight=makedirs#os.makedirs">http://docs.python.org/py3k/library/os.html?highlight=makedirs#os.makedirs</a></div>
<div><br></div><div>Tim Delaney </div></div>