Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to run multiple python functions at a time #89

Open
admill1519 opened this issue Feb 5, 2018 · 0 comments
Open

how to run multiple python functions at a time #89

admill1519 opened this issue Feb 5, 2018 · 0 comments

Comments

@admill1519
Copy link

def som():
cursor.execute("select Number from demo")
res = cursor.fetchall()
for i in res:
mac.send_message_to("lunch after 15mins",str(i[0]))

@signals.initialized.connect
def notify(entity):
a = str(datetime.date.today())
cursor.execute("select Time from demo")
b = cursor.fetchall()
for i in b:
tm = i[0].strftime("%Y-%m-%d %H:%M")
dy = tm.split(" ")[0].strip()
hr = tm.split(" ")[1].strip()
if dy == a:
schedule.every().day.at(hr).do(som)

     while True:
         schedule.run_pending()
         time.sleep(60)

This function sends the notifications to the user at particular time. If I am using this function bot is not able to give response to the other queries like "hi","help" or any other which I have defined. How can I run both functions in parallel so that bot can send message to the relevant query as well as it will send auto notification to the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant