# Author:XiangLiang
import queue

#q = queue.LifoQueue() #先进后出
#q = queue.PriorityQueue() #优先级
q = queue.Queue(maxsize=3) #固定大小,先进先出


q.put(1)
q.put(2)
q.put(3)

print(q.get())
print(q.get())
print(q.get())

#队列两大功能:
#1.解耦,使程序直接实现松耦合
#2.提高处理效率

相关文章:

  • 2021-07-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-07
  • 2022-12-23
猜你喜欢
  • 2021-07-01
  • 2021-11-19
  • 2021-12-09
  • 2021-09-08
  • 2021-11-16
  • 2021-11-20
相关资源
相似解决方案