title: How can I repeat something for x minutes in Python?
body: <p>I have a program (temptrack) where I need to download weather data every x minutes for x amount of hours. I have figured out how to download every x minutes using <code>time.sleep(x*60)</code>, but I have no clue how to repeat this process for a certain amount of hours.</p>
  
  <p>UPDATE:
  Thank you to everyone who posted a solution.
  I marked the example using "datetime.datetime.now() + datetime.timedelta(hours=x)" as the best answer because I could understand it the best and it seems like it will work very well for my purpose.</p>