Creating Frames in tkinter
<p>In the following code I am creating a window and a frame inside it. </p>

<p>Code 1:</p>

<pre><code>import tkinter as tk


class MainApp(tk.Frame):

    def __init__(self, parent):

        tk.Frame.__init__(self, parent)
        self.parent = parent

        button = tk.Button(parent, text="a button")
        button.pack()


root = tk.Tk()
app = MainApp(root)
app.pack(fill="both", expand=True)
root.mainloop()
</code></pre>

<p>Code 2:</p>

<pre><code>import tkinter as tk


class MainApp(tk.Frame):

    def __init__(self, parent):

        tk.Frame.__init__(self, parent)
        self.parent = parent

        button = tk.Button(self, text="a button")
        button.pack()


root = tk.Tk()
app = MainApp(root)
app.pack(fill="both", expand=True)
root.mainloop()
</code></pre>

<p>Then I create a button in two ways (<code>Button(self)</code> and <code>Button(parent)</code>). The question is: Do the buttons, in both cases, get placed in the frame that I created (like that: <code>tk.Frame.__init__(self, parent)</code>), both next to it, or one next to it and one inside it?
If both get created inside it, what's the point in doing <code>tk.Frame.__init__(self, parent)</code> if nothing goes inside it?</p>