title: Python: Using schedule library with a class fuction
body: <blockquote>
    <blockquote>
      <p>I am new to Python.</p>
    </blockquote>
  </blockquote>
  
  <p>Trying to implement <code>schedule</code> library to run a cron job. It is a simplistic library which does the basic job. <br> Calling a function like this work fine:</p>
  
  <pre><code>import schedule
  import time
  
  def job():
      print("I'm working...")
  
  schedule.every(10).minutes.do(job)
  while True:
      schedule.run_pending()
      time.sleep(1)
  </code></pre>
  
  <p>I am not able to figure out how to call the function from a class. Tried doing like this but while loop doesn't work:</p>
  
  <pre><code>import schedule
  import time
  
  class Recommendation:
  
      def job(self):
          print "I'm working"
  
  if __name__ == "__main__":
      rec = Recommendation()
      schedule.every(1).minutes.do(rec.job())
      while True:
          schedule.run_pending()
          time.sleep(1)
  </code></pre>