import tkinter
import random

column1=[]
column2=[]
column3=[]

# Read contents of column1.txt and add the contents to the 1st list
file1 = open("column1.txt","r")
line = file1.readline()
while line != "":
    column1.append(line)
    line = file1.readline()
file1.close()

# Read contents of column2.txt and add the contents to the 2nd list
file2 = open("column2.txt","r")
line = file2.readline()
while line != "":
    column2.append(line)
    line = file2.readline()
file2.close()

# Read contents of column3.txt and add the contents to the 3rd list
file3 = open("column3.txt","r")
line = file3.readline()
while line != "":
    column3.append(line)
    line = file3.readline()
file3.close()

def pickName():
    nameLabel.configure(text=("Thou ") + random.choice(column1)+(" ") +random.choice(column2)+(" ") +random.choice(column3))

root = tkinter.Tk()
root.title("Shakespearean insult generator")
root.geometry("300x200")

nameLabel = tkinter.Label(root, text="", font=("Helvetica", 32))
nameLabel.pack()

pickButton = tkinter.Button(text="Press For An Insult!", command=pickName)
pickButton.pack()

oldLabel = tkinter.Label(root, text="", font=("Helvetica", 32))
oldLabel.pack()

root.mainloop()
