Python get last month and year : <p>I am trying to get last month and current year in the format: July 2016.</p>

<p>I have tried (but that didn't work) and it does not print July but the number:</p>

<pre><code>import datetime
now = datetime.datetime.now()
print now.year, now.month(-1)
</code></pre>
