- 1
20th Nov 2022, 7:30 AM
ivor
ivor - avatar
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
20th Nov 2022, 12:05 PM
Lothar
Lothar - avatar
+ 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.
20th Nov 2022, 8:06 AM
Tibor Santa
Tibor Santa - avatar
0
prio.get() dequeues
20th Nov 2022, 7:10 PM
Oma Falk
Oma Falk - avatar