queue的一些用法
import queue q = queue.Queue(3)# 指定队列大小,如果为空则为无限大 print(q.empty()) q.put('厉智') q.put('程劲') q.put('陈培昌') print(q.full()) for i in range(q.qsize()): print(q.get()) print(q.full())
import queue q = queue.Queue(3)# 指定队列大小,如果为空则为无限大 print(q.empty()) q.put('厉智') q.put('程劲') q.put('陈培昌') print(q.full()) for i in range(q.qsize()): print(q.get()) print(q.full())