본문 바로가기
Python

[python] queue 를 list 로 (queue to list)

by bryan.oh 2021. 5. 4.
반응형

 

list(que.queue)

 

from queue import Queue

que = Queue()

que.put(111)
que.put(222)
que.put(333)

results = list(que.queue)

print(results)
# results = [111, 222, 333]

print(q.empty()) # False
print(q.qsize()) # 3
print(q.get())   # 111
print(q.qsize()) # 2

print(results)
# results = [111, 222, 333]

 

 

728x90
반응형

댓글