How do queues work in python? -
this question has answer here:
- how implement priority queues in python? 2 answers
i trying learn python stuff, , wondering if can me examples of using priority queue. know in java how work, cant seem see clear examples of how work in python. getting size of queue saw .qsize() here: http://docs.python.org/2/library/queue.html doesn't show examples of getting min, max, organizing, popping, adding queue, sorting them, iterating through them. if can give me example of these or point me in right direction of learn i'd appreciate it.
the queues in queue
module geared toward implementation of producer/consumer pattern of multithreading. if you're interested in general-purpose priority queue data structure, use heapq
module.
Comments
Post a Comment