title: Tkinter function runs automatically
body: <p>So im trying to make a problem for school which helps students access things easier, a part of this is getting all the PDF files they may need. Ive created a menu in Tkinter but the code will start without me choosing what to do. </p>
  
  <pre><code>import tkinter as tk
  import webbrowser
  
  root = tk.Tk()
  root.title("School Tool")
  root.geometry("300x300")
  root.configure(background='black')
  
  
  menu = tk.Menu(root, bg="blue")
  root.config(menu=menu)
  
  
  root = tk.Tk()
  root.title("School Tool")
  root.geometry("300x300")
  root.configure(background='black')
  
  
  menu = tk.Menu(root, bg="blue")
  root.config(menu=menu)
  
  def openKillersTears():
      url = 'http://www.python.org/'
      webbrowser.open_new(url)
  
  class subMenu:
  submenu = tk.Menu(menu, bg="Black", fg="white",tearoff=0)
  menu7= tk.Menu(submenu, bg="Black", fg="white",tearoff=0)
  menu8 = tk.Menu(submenu, bg="Black", fg="white",tearoff=0)
  menu9 = tk.Menu(submenu, bg="Black", fg="white",tearoff=0)
  menu10 = tk.Menu(submenu, bg="Black", fg="white",tearoff=0)
  menu11 = tk.Menu(submenu, bg="Black", fg="white",tearoff=0)
  menu12 = tk.Menu(submenu, bg="Black", fg="white",tearoff=0)
  
  menuKillersTears = tk.Menu(menu9, bg="Black", fg="white",tearoff=0,)
  menuKillersTears.add_command(label="Killers Tears", command=openKillersTears())
  
  menu.add_cascade(label="PDF's", menu=submenu, )
  submenu.add_cascade(label="Year 7", menu=menu7)
  submenu.add_cascade(label="Year 8", menu=menu8)
  submenu.add_cascade(label="Year 9", menu=menu9)
  submenu.add_cascade(label="Year 10", menu=menu10)
  submenu.add_cascade(label="Year 11", menu=menu11)
  submenu.add_cascade(label="Year 12", menu=menu12)
  
  menu7.add_cascade(label="English")
  menu7.add_cascade(label="Math")
  menu7.add_cascade(label="Science")
  menu7.add_cascade(label="History / Humanities")
  
  menu8.add_cascade(label="English")
  menu8.add_cascade(label="Math")
  menu8.add_cascade(label="Science")
  menu8.add_cascade(label="History")
  
  menu9.add_cascade(label="English", menu=menuKillersTears,)
  menu9.add_cascade(label="Math")
  menu9.add_cascade(label="Science")
  menu9.add_cascade(label="History")
  
  menu10.add_cascade(label="English")
  menu10.add_cascade(label="Math")
  menu10.add_cascade(label="Science")
  menu10.add_cascade(label="History")
  
  menu11.add_cascade(label="English")
  menu11.add_cascade(label="Math")
  menu11.add_cascade(label="Science")
  menu11.add_cascade(label="History")
  
  menu12.add_cascade(label="English")
  menu12.add_cascade(label="Math")
  menu12.add_cascade(label="Science")
  menu12.add_cascade(label="History")
  
  root.mainloop()
  </code></pre>
  
  <p>ill run it and it will connect to the site without me choosing the option on the menu, and when i do choose the option on the menu nothing happens</p>
  
  <p>any ideas?</p>