我想同时运行两个程序。我已经使用线程工作。现在,我尝试使用多处理来做同样的事情。但是,当在通过多处理程序运行的程序中使用while循环时,只有一个功能继续执行,而第二个功能没有执行。如何将控件转移到第二功能。已显示尝试的代码:
from multiprocessing import Proces
def func1():
while True:
print ('Working1')
def func2():
while True:
print ('Working2')
if __name__ == '__main__':
Process(target = func1).start()
Process(target = func2).start()