title: Python Tkinter Toplevel
body: <p>I am working on a program that requires multiple windows, and the first one to appear is the login window, I used the Toplevel widget in order to make other windows its children, but this code keeps showing two windows instead of one.</p>
  
  <pre><code>from Tkinter import Frame, Toplevel
  from ttk import Label, Entry, Button
  
  
  class loginWindow(Toplevel):
      def __init__(self):
          Toplevel.__init__(self)
          self.title("Title")
          self.frame = Frame(self)
          self.frame.pack()
          self.__make_layout()
          self.mainloop()
  
      def __make_layout(self):
          self.frame.user_name_label = Label(text="User name:")
          self.frame.user_name_text = Entry()
          self.frame.user_name_label.grid(row=0, column=0)
          self.frame.user_name_text.grid(row=0, column=1)
          self.frame.password_label = Label(text="Password:")
          self.frame.password_text = Entry()
          self.frame.password_label.grid(row=1, column=0)
          self.frame.password_text.grid(row=1, column=1)
          self.frame.login_button = Button(text="Login")# , command=self.__create_window)
          self.frame.login_button.grid(row=2, column=0, columnspan=2)
  
  
  if __name__ == '__main__':
      win1 = loginWindow()
  </code></pre>