title: Stop execution of code python(Spyder/Ipython)
body: <p>I'm coding a program (Python 3.6 on Spyder) that will analyse some reports. When the analysis is finished, i click on the exit button, but the code is still running on the console Ipython, how can i fix it ?</p>
  
  <p>I tried with window.destroy() ; window.quit(); window.exit() but no way the code still running on the Ipython console.</p>
  
  <pre><code># MAIN
  
  window= Tk()
  
  window.title("Cash Feed Upload Analysis")
  
  window.configure(bg="SteelBlue1")
  
  Label(window, text="Voici les rapports du jour:", bg="SteelBlue1",fg="black", font="none 14 bold").grid(row=1,column=0,sticky=W)
  
  Button(window, text="Select reports", width=12, command=select).grid(row=3,column=0,sticky=W)
  
  output= Text(window,width=90, height=12, wrap=WORD, background="white")
  
  output.grid(row=5,column=0, columnspan=2, sticky=W)
  
  window.mainloop()
  window.destroy
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/B3PMX.png" rel="nofollow noreferrer">Explaining picture</a></p>
  
  <p>Thanks in advance.</p>