Python Queue Module
Thread-safe queues — Queue, LifoQueue, PriorityQueue, SimpleQueue. This category documents 10 Python queue module entries, and each page gives you the full syntax, the parameter list, the return value, and a runnable example. The entries include: queue.Queue(), queue.LifoQueue(), queue.PriorityQueue(), Queue.put(), Queue.get(), Queue.task_done(), Queue.join(), Queue.qsize(), Queue.empty(), Queue.full(). queue.Queue() creates a FIFO (First-In-First-Out) thread-safe queue. queue.LifoQueue() creates a LIFO (Last-In-First-Out) thread-safe queue (stack). queue.PriorityQueue() creates a thread-safe priority queue (lowest value is retrieved first). Queue.put() puts an item into the queue. Blocks if full until space is available. Queue.get() removes and returns an item from the queue. Blocks if empty. Queue Module belongs to the Collections & Iteration group alongside Collections Module, Itertools Module, Functools Module, Operator Module. You can also search across every category from the search page, browse the complete A–Z index, or try any example in the Python playground.