from multiprocessing import Process,Queue def f1(q): q.put('约吗?') if __name__ == '__main__': q = Queue(3) p = Process(target=f1,args=(q,)) p.start() son_p_msg = q.get() print('来自子进程的消息:',son_p_msg)
from multiprocessing import Process,Queue def f1(q): q.put('约吗?') if __name__ == '__main__': q = Queue(3) p = Process(target=f1,args=(q,)) p.start() son_p_msg = q.get() print('来自子进程的消息:',son_p_msg)