📜  python 从队列中获取项目 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:36.935000             🧑  作者: Mango

代码示例1
"""put and get items from queue"""
>>> from Queue import Queue
>>> q = Queue()
>>> q.put(1)
>>> q.put(2)
>>> q.put(3)
>>> print list(q.queue)
[1, 2, 3]

>>> q.get()
1
>>> print list(q.queue)
[2, 3]