title: Scheduling same method to run for different inputs corresponding to its time interval
body: <p>I am a beginner in Python. I have a python script that needs to be executed always. The script is taking some url s from DB and calling some functions to check activity of links. These functions should be executed at specific intervals for each urls(value specific for each url and is taking from db while retrieving urls). I read about sched module and cron tabs but got bit confused on what to use and how to use them to achieve all these!or is there a better solution to implement all this? 
  1) run the script always
  2)in code for each url the interval to call/check a method is different, and each should be checked in its particular time interval
  My main code will be something like</p>
  
  <pre><code>def checkSublinks(urlId,search,domain,depth_restricted_to,links_restricted_to):
             #method here
  
  
  try:
    db=MySQLdb.connect("localhost","root","password","crawler") 
    cursor=db.cursor();
    query="select * from website"
    cursor.execute(query)
    result=cursor.fetchall()
  
    for row in result:
  
      depth=0
      maxCountReached=False
      urlId=row[0]
      print "Id :",urlId
      search=row[1]
      domain=row[2]
      depth_restricted_to=row[3]
      links_restricted_to=row[4]
      website_uptime=row[5]
      link_uptime=row[6]
      checkSublinks(urlId,search,domain,depth_restricted_to,links_restricted_to)
  
  except Exception,e:
    print e
    print "Error in creating DB Connection!"
  finally:
    db.close()
  </code></pre>
  
  <p>Here each url is calling checkSublinks in its corresponding time interval. Request your valuable suggestions in this at the earliest</p>