- 1
anyone can help me how to dequeue in python?
3 Answers
+ 4
ivor ,
please provide a proper task description so that we know what you are going to achieve with your code.
with the currently provided information in youf question we only can guess what exactly your issue is.
if you expect to get real help from the community, you should put some more effort in describing your problem
+ 3
What do you mean exactly by dequeue?
For PriorityQueue you use the put method to add items and the get method to remove items.
Check the API documentation here:
https://docs.python.org/3/library/queue.html#queue.PriorityQueue
You can only remove items at one end.
If you need to add or remove elements at both ends, you can try collections.deque which is a double-ended queue.
0
prio.get() dequeues