I want to use rq_scheduler library in my app and this is my code :
import telepot
import sys
import time
import schedule
import datetime
from redis import Redis
from rq_scheduler import Scheduler
scheduler = Scheduler(connection=Redis())
def handle():
print("hello")
def main():
scheduler.enqueue_at(datetime(2017, 9, 11, 22, 41),handle)
if __name__ == '__main__':
main()
and I get this : update :
Traceback (most recent call last):
File "***\__init__.py", line 22, in <module>
main()
File "***\__init__.py", line 18, in main
scheduler.enqueue_at(datetime(2017, 9, 11, 22, 41),handle)
TypeError: 'module' object is not callable
1- where is my mistake? why am I getting this ?