F
F
freiqq2022-01-09 22:39:50
Python
freiqq, 2022-01-09 22:39:50

How to run two functions in parallel?

I have a telegrambot (telebot) that starts the parser when the command ''Update data'' is entered. Now I tried to implement an automatic update (every 30 minutes), but nothing happened. How can you run two infinitely running functions at the same time:

schedule.every(30).minutes.do(main)
while True:
    schedule.run_pending()


telegram_bot(token)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
shurshur, 2022-01-09
@freiqq

Either threads or asynchrony.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question