title: finding first day of the month in python
body: <p>I'm trying to find the first day of the month in python with one condition: if my current date passed the 25th of the month, then the first date variable will hold the first date of the next month instead of the current month. I'm doing the following:</p>
  
  <pre><code>import datetime 
  todayDate = datetime.date.today()
  if (todayDate - todayDate.replace(day=1)).days &gt; 25:
      x= todayDate + datetime.timedelta(30)
      x.replace(day=1)
      print x
  else:
      print todayDate.replace(day=1)
  </code></pre>
  
  <p>is there a cleaner way for doing this?</p>