How to check Queue\'s length in python?
I dont see they provide Queue.lenght in python....
http://docs.python.org/tutorial/datastructures.html
fr
it is simple just use .qsize() example:
a=Queue() a.put("abcdef") print a.qsize() #prints 1 which is the size of queue
The above snippet applies for Queue() class of python. Thanks @rayryeng for the update.
Queue()
for deque from collections we can use len() as stated here by K Z.
deque from collections
len()