title: Tkinter Label Text Overlaps in Specific Loop
body: <p>I'm working on a "simple" search interface using Python and Tkinter. Here is some example code of what I've got:</p>
  
  <pre><code>#!/usr/bin/env/python
  
  from tkinter import *
  import os
  import csv
  import sys
  
  def fetch()
  
      word = e1.get()
      definitions = []
  
      with open(file) as db:
          dbreader = csv.reader(db, delimiter="\t")
          for row in dbreader:
              if word in row[1]:
                  definitions.append(row[4])
  
      if not definitions:
          output_string = word + " not in database"
  
      else:
          output_string = "Found " + word
  
      result_out = Label(master)
      result_out.config(text=output_string)
      result_out = result_out.grid(row=3, column = 0)
  
  master = Tk()
  
  word_entry = Label(master, text = "word")
  word_entry.grid(row=0, column = 0)
  
  e1 = Entry(master)
  
  e1.grid(row=0, column=1)
  
  Button(master, text='Search', command=fetch).grid(row=2, column=1, sticky=(N, S, W, E), pady=4)
  
  mainloop()
  </code></pre>
  
  <p>The code operates as intended if I am searching words that are found in the database. If I search a word that is not in the the database, my next search with a word that is present will overlap the previous output. The opposite is true, if I only search items not found in the database, the label refreshes as expected. When these loops "alternate" I experience issues. What in the world is going on?</p>