dequeue object from front of queue
<p>Am trying to dequeue a random shape from the front of the queue in my tkinter program. I have tried the <code>is_empty()</code> method but I seem to get an error. </p>

<pre><code>&gt;&gt;&gt; AttributeError: 'Queue' object has no attribute 'pop'.
</code></pre>

<p>Any help would be great thanks !<br>
This is the queue class I'm using </p>

<pre><code>class Queue:
  def __init__(self):
    self.items = []
  def is_empty(self):
    return self.items == []
  def size(self):
    return len(self.items)
  def enqueue(self, item):
    self.items.insert(0, item)
  def dequeue(self):
    return self.items.pop(0)
  def peek(self):
    return self.items[0]
</code></pre>

<p>class Recta:</p>

<pre><code>def __init__(self, height=60, width=80 ):
    self.height = height
    self.width = width
    self.create_buttons()
    self.canvas = Canvas(root)
    self.canvas.pack()
    self.queue = Queue()  



def remove_triangle(self):
    if not self.queue.is_empty(): 
         self.canvas.delete(self.queue.pop())
</code></pre>