Skip to content

Latest commit

 

History

History
37 lines (31 loc) · 947 Bytes

day11.md

File metadata and controls

37 lines (31 loc) · 947 Bytes

第十一天

索引

python标准库 queue-- Thread-Safe FIFO Implementatio

  1. basic
import queue

q = queue.Queue()

for i in range(5):
    q.put(i)

while not q.empty():
    print(q.get(), end=' ')
print()
  1. LIFO Queue¶
import queue

q = queue.LifoQueue()

for i in range(5):
    q.put(i)

while not q.empty():
    print(q.get(), end=' ')
print()
  1. Priority Queue