Want datetime in logfile name
<p>When I create my logfile,  I want the name to contain the datetime.</p>

<p>Now, in python you can get the current datetime as:</p>

<pre><code>&gt;&gt;&gt; from datetime import datetime
&gt;&gt;&gt; datetime.now()
datetime.datetime(2012, 2, 3, 21, 35, 9, 559000)
</code></pre>

<p>The str version is</p>

<pre><code>&gt;&gt;&gt; str(datetime.now())
'2012-02-03 21:35:22.247000'
</code></pre>

<p>Not a very nice str to append to the logfile name!  I would like my logfile to be something like:</p>

<pre><code>mylogfile_21_35_03_02_2012.log
</code></pre>

<p>Is there something python can to do to make this easy to do?  note, I am creating the log file as</p>

<pre><code>fh = logging.FileHandler("mylogfile" + datetimecomp + ".log")
</code></pre>

<p>Any tips?</p>
