title: How to define date range and assign it to a variable in python
body: <p>I need to amend an existing python sript which extracts data from previous day to extract data for last two weeks like biweekly data. Please advise how I can twik to get the date range in the variable</p>
  
  <pre><code>def parse_gov():
      reject_patterns = generate_reject_patterns()
  
      today_str = date.today().strftime('%Y.%m.%d')
      yesterday =
      yesterday_str = yesterday.strftime('%Y.%m.%d')
      query_date = date.today()
  </code></pre>
  
  <p>So need to get the date range in yesterday variable</p>