Python Runtime error on restart of script
<p>I have a simple Tkinter, Matplotlib python program. I am using Windows 10 and the program works fine until I close the window.  Upon restarting the script I recieve a runtime error (see image).  I tried to "contact the application's support team for more information" then I realized that I am the application support team....</p>

<p><a href="https://i.stack.imgur.com/9j1Bz.png" rel="nofollow"><img src="https://i.stack.imgur.com/9j1Bz.png" alt="enter image description here"></a></p>

<pre><code>    #!/usr/bin/env python
import matplotlib
import time
matplotlib.use('TkAgg')

from numpy import arange, sin, pi
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from matplotlib.figure import Figure
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from tkFileDialog import *

import sys
import Tkinter as Tk


def destroy(e):
    sys.exit()

class Window():
    def __init__(self):

        self.root = Tk.Tk()
        self.root.wm_title("Embedding in TK")
        self.QuitButton = None
        self.UploadButton = None
        self.filepath = None
        self.fig = None
        self.canvas =   None
        self.image = None




    def showWindow(self):
        self.root.mainloop()

    def addQuitButton(self, ButtonText):
        if self.QuitButton is None:
            self.QuitButton = Tk.Button(master = self.root, text = ButtonText, command = self.closeWindow)
            self.QuitButton.pack(side=Tk.BOTTOM)

    def addUploadButton(self, ButtonText):
        if self.UploadButton is None:
            self.UploadButton = Tk.Button(master = self.root, text = ButtonText, command = self.showFileDialog)
            self.UploadButton.pack(side=Tk.BOTTOM)

    def showFileDialog(self):
        print 'oh yeah'
        if self.filepath is None:
            print 'Oh no...'
            self.filepath = askopenfilename(parent=self.root)
            print self.filepath
        self.image = mpimg.imread(self.filepath)
        self.buildFigure()
        self.showCanvas()

    def buildFigure(self):
        self.fig = plt.figure()
        self.im = plt.imshow(self.image) 


    def showCanvas(self):
        self.canvas = FigureCanvasTkAgg(self.fig, master=self.root)
        self.canvas.show()
        self.canvas.get_tk_widget().pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)



    def closeWindow(self):
        #sys.exit()
        self.root.quit()
        self.root.destroy()





if __name__== "__main__":
    base = Window()
    base.addQuitButton("Quit")
    base.addUploadButton("Upload")
    base.showWindow()
</code></pre>