1
我将写在Python 2到Python 3源代码,我偶然到这一点:如何将'从队列导入队列,空'从Python 2转换为Python 3?
from Queue import Queue, Empty
我把它改为:
from multiprocessing import Queue, Empty
但是这给了我一个例外:
ImportError: cannot import name 'Empty'
我该如何解决这个问题?
'Queue'是python 3中的'队列'。 – tdelaney
'from queue import Queue,Empty' – Nicarus