title: Python: Need to request only 20 times per minute
body: <p>I have made a python code that uses a api to request some data, but the api only allows for 20 requests per minute. I am using urllib to request the data. Also I am using a for loop because the data is located in a file:</p>
  
  <pre><code>for i in hashfile:
      hash = i
      url1 = "https://hashes.org/api.php?act=REQUEST&amp;key="+key+"&amp;hash="+hash
      print(url1)
      response = urllib.request.urlopen(url2).read()
      strr = str(response)
  
      if "plain" in strr:
          parsed_json = json.loads(response.decode("UTF-8"))
          print(parsed_json['739c5b1cd5681e668f689aa66bcc254c']['plain'])
          writehash = i+parsed_json
          hashfile.write(writehash + "\n")
      elif "INVALID HASH" in strr:
          print("You have entered an invalid hash.")
      elif "NOT FOUND" in strr:
          print("The hash is not found.")
      elif "LIMIT REACHED" in strr:
          print("You have reached the max requests per minute, please try again in one minute.")
      elif "INVALID KEY!" in strr:
          print("You have entered a wrong key!")
      else:
          print("You have entered a wrong input!")
  </code></pre>
  
  <p>Is there a way to make it just do 20 requests per minute? or if that isn't possible can I make it timeout after 20 tries? 
  (btw, it's just part of the code)</p>