Answer the question
In order to leave comments, you need to log in
1 process shutting down after turning on two other python threading?
import time
from threading import Thread
from telebot import TeleBot, types
bot = TeleBot('')
threads = {}
def some_func(us, text):
time.sleep(10000)
@bot.message_handler(commands=['start'])
def start_command(message):
us = message.chat.id
threads[us] = Thread(target=some_func(us, message.text))
threads[us].start()
def start():
bot.polling()
thr1 = Thread(target=start)
if __name__ == '__main__':
thr1.start()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question