How can i get userinput in a thread without EOFError occuring in python?
问题 I am trying to receive/send data at the same time, and my idea to doing this was import multiprocessing import time from reprint import output import time import random def receiveThread(queue): while True: queue.put(random.randint(0, 50)) time.sleep(0.5) def sendThread(queue): while True: queue.put(input()) if __name__ == "__main__": send_queue = multiprocessing.Queue() receive_queue = multiprocessing.Queue() send_thread = multiprocessing.Process(target=sendThread, args=[send_queue],)