'running two code-blocking python scripts at once
i have two pieces of code, one a server and one a discord.py bot i want them to run seperately and i tried two things in order to achieve this and they both didn't work
first, i tried running the two scripts in batch like this:
py main.py
py server.py
then i tried using multiprocessing:
import multiprocessing
import os
def func1():
os.system("py main.py")
def func2():
os.system("py server.py")
p1 = multiprocessing.Process(target=func1)
p1.start()
p2 = multiprocessing.Process(target=func2)
p2.start()
but this still didn't work. only the first script ran instead of both, which was what i was looking for can someone help me?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
