Answer the question
In order to leave comments, you need to log in
How to run multiple python files at the same time?
Hello, I want to run 2 bots at the same time, but it doesn't work
import bot_1, bot_2
from threading import Thread
Thread(target=bot_2.main).start()
Thread(target=bot_1.main).start()
Answer the question
In order to leave comments, you need to log in
So run them separately. Why do you need to combine them in one process?
Wrap the start of the bot not in main but in the usual function startbotX and start like this
if __name__ == '__main__':
Thread(target = startbot1).start()
Thread(target = startbot2).start()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question