from liveMan import DouyinLiveWebFetcher, DouyinLiveWebReply from helper import PromptQueue from multiprocessing import Process, Event, freeze_support def fetch_user_chat_content(ws_open_event, queue): fetcher = DouyinLiveWebFetcher(ws_open_event, queue) fetcher.start() def reply_user_chat_content(queue): reply = DouyinLiveWebReply(queue) reply() if __name__ == '__main__': freeze_support() queue = PromptQueue(10) ws_open_event = Event() fetch_process = Process(target=fetch_user_chat_content, args=(ws_open_event, queue)) reply_process = Process(target=reply_user_chat_content, args=(queue,)) fetch_process.start() ws_open_event.wait() reply_process.start() fetch_process.join() reply_process.join()