Tkinter place x/y parameter
This is the method that places the widget control in a container (think of it as a window) using a direct designation.
The syntax of the place method has the following format:
place(options, ...)
The options parameters can be height/width, relx/rely, x/y, relheight/relwidth, bordermode, and anchor.
The x and y parameters within the place( ) method directly set the top-left position of the window component in pixels. The upper left corner of the window display area is (x=0,y=0), x is incremented to the right, and y is incremented down. Also when using this method, the window will not be automatically resized but will be displayed using the default size.
Tkinter place x/y Example#1
Set the position of the Label directly using the place() method –
from tkinter import *
window = Tk()
window.title("apidemos.com")
lab1 = Label(window,text="Label 1",
bg="lightyellow",width=15)
lab2 = Label(window,text="Label 2",
bg="lightgreen",width=15)
lab3 = Label(window,text="Label 3",
bg="lightblue",width=15)
lab1.place(x=0,y=0)
lab2.place(x=30,y=50)
lab3.place(x=60,y=100)
window.mainloop()
Output: