Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

queue in python

import queue
 
q = queue.Queue # initialisation

# get() – Remove and return an item from the queue. If queue is empty, wait until an item is available.
# put(item) – Put an item into the queue. If the queue is full, wait until a free slot is available before adding the item.
# empty() – Return True if the queue is empty, False otherwise.  
# maxsize – Number of items allowed in the queue.
# full() – Return True if there are maxsize items in the queue. If the queue was initialized with maxsize=0 (the default), then full() never returns True.
# get_nowait() – Return an item if one is immediately available, else raise QueueEmpty.
# put_nowait(item) – Put an item into the queue without blocking. If no free slot is immediately available, raise QueueFull.
# qsize() – Return the number of items in the queue.
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #queue #python
ADD COMMENT
Topic
Name
8+6 =