title: Python - queue.clear() doesn't works
body: <p>Hello I write an application for modem ST75-80. My problem is while I click on "Reset" button in my app first time I receive good frames. When i click more than one time "Reset" button queue doesn't clear and values append to already index.</p>
  
  <p><code>ser</code> is a variable which operate on pySerial library </p>
  
  <pre><code>global ser
  ser = serial.Serial()
  global q
  q = queue.Queue()
  
  def serveException():
          try:
              time.sleep(0.05)
              t2 = Thread(target=receiveData, args=())
              if(t2.isAlive()==False):
                  t2.start()
          except:
              print("Nie moze wystartowac watek")    
  
  def receiveData():
      global ser
      global q
      while(True):
          if(ser.isOpen() == True):
              if(ser.inWaiting()):
                  s = ser.read()
                  for i in s:
                      q.put(i)
                  while not q.empty():
                      print(hex(q.get()))
                      q.queue.clear()
  
  def sendReset():
      try:
          tablicaHEX = bytes([0x02, 0x00, 0x3C, 0x3C, 0x00])
          ser.setRTS(True)
          ser.setDTR(True)
          time.sleep(0.01)
          ser.write(bytes(tablicaHEX))
          ser.setRTS(False)
          ser.setDTR(True)
          serveException()
      except:
          print("nie")
  
  def createResetButton():
       buttonReset = Button(text = "Reset", command=sendReset)
       buttonReset.grid(row=2, column = 2)
  
  def createFrame():
      mainFrame = tkinter.Tk()
      mainFrame.geometry('300x200')
      createLabel()
      createDataList()
      listOfComPorts(mainFrame)
      createConnectButton()
      createResetButton()
      mainFrame.mainloop()
  
  def main():
      createFrame()
      ser.close
  </code></pre>
  
  <p>My question is: What can i do? I would receive the same data as at first time: </p>
  
  <p>Output:</p>
  
  <pre><code>0x3f
  0x9
  0x6 
  </code></pre>
  
  <p>itd itd. 
  Next Click</p>
  
  <pre><code>0x3f0x9
  
  0x60x2
  </code></pre>