Q:

How to tell a widget to stay in one GUI

So i am trying to make a pop up GUI for a program I am making and i have been testing different methods.  The problem is that the widgets I create all go to the first GUI I created is there a way to tell what GUI the widget is going to be on.  
from Tkinter import *

def sailors ():
    Root = Tk ()
    Root.title ('Error')
    info = Label (text = 'Fire')
    info.grid (row = 0, column = 0)
    you = Button (text = "OK", command = sys.exit )
    info.grid (row = 1, column = 0)
    Root.mainloop ()

root1 = Tk ()
YES= Button (text = 'Coolio', command = sailors )
YES.pack ()
root1.mainloop ()

A:

The first parameter when creating a widget specifies the parent.
root = Tk()
info = Label(root, ...)
you = Button(root, ...)

However, in your code you are creating two instances of Tk. Tkinter isn't designed to work like that. You should only ever create exactly one instance of Tk, and call mainloop() exactly once. If you need multiple windows, every window but the first should be an instance of Toplevel.

