title: How to use date range in python to pull /query data in mySQL
body: <p>How can I pull data in mySQL by day using python date?
  Say I want <code>day1</code> and <code>day2</code> ( or a day after <code>day1</code> ) iterate for <code>n</code> times </p>
  
  <p>So I need the date in "where" SQL statement to look like below list in each iteration (<code>n</code> times )</p>
  
  <pre><code>day1 &gt;= '2012-01-01'  and  day2 &lt; '2012-01-02'    ( n = 1 )
  day1 &gt;= '2012-01-02'  and  day2 &lt; '2012-01-03'    ( n = 2 )
  .
  .
  day1 &gt;= yesterday    and day2  &lt; today            ( n times ) 
  </code></pre>
  
  <p>.</p>
  
  <pre><code>Start_date = '2012-01-01'   &lt;- How can I write this in python
  End_date = Today()   &lt;- and this 
  </code></pre>
  
  <p>So as to write:</p>
  
  <pre><code>for each iteration ..
      con.execute("select * from table where date &gt;= day1 and date &lt; day2" )
  </code></pre>