Python Tkinter Label in Frame
<p>I want to place a label inside a frame in tkinter, but I can't figure out how to actually get it inside.</p>

<pre><code>import tkinter
from tkinter import *

W=tkinter.Tk()
W.geometry("800x850+0+0")
W.configure(background="lightblue")

FRAME=Frame(W, width=100, height =50).place(x=700,y=0)

LABEL=Label(FRAME, text="test").pack()
</code></pre>

<p>When I run this, it doesn't place the Label inside the frame, but just places it normally on the window.
What am I doing wrong?</p>

<p>In the line</p>

<pre><code>FRAME=Frame(W, width=100, height =50).place(x=700,y=0)
</code></pre>

<p>You think you are returning a tk frame, but you are not! You get the return value of the place method, which is <code>None</code></p>

<p>So try</p>

<pre><code>frame = Frame(W, width=100, height=50)
frame.place(x=700, y=0)
label = Label(frame, text="test").pack()
</code></pre>

<p>If you don't want the frame to shrink to fit the label, use (<a href="http://stackoverflow.com/questions/563827/how-to-stop-tkinter-frame-from-shrinking-to-fit-its-contents">How to stop Tkinter Frame from shrinking to fit its contents?</a>)</p>

<pre><code>frame.pack_propagate(False) 
</code></pre>

<p>Note: Either <code>import tkinter</code> or <code>from tkinter import *</code> but not both. Also, by convention, names of instances of objects are lowercase.</p>

python tkinter label frame