同时,我仍然需要一个线程来处理输入,而我现在仍然需要一个输出方式。在
现在我有这样的东西
def thread_func():
while True:
print("Information")
threading.Thread(target=thread_func).start()
while True:
command = raw_input("Enter a command:")
#dostuff with command
我现在的问题是我的线程没有打印任何内容。或者如果是的话就没有出现
编辑:
在这里找到了解决办法 Exiting while loop by pressing enter without blocking. How can I improve this method?
您想使用Queue。新的输入将进入队列的后面,工作将从前面开始。在
相关问题 更多 >
编程相关推荐