Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

easiest way to position labels in tkinter

#The easiest way to position labels on the screen is to use the 'place' method

#Do the following

# Import tkinter
from tkinter import *

# Create a window (does not have to be a root window)
window = Tk()
window.title("Positioning Labels")
window.geometry("900x600")

# Create a label
Label(window, text = "This is a label").place(x = 80, y = 120)
"""
What we did was:
	- create a label using the 'Label()' function
    - told where the label should be placed 'window'
    - what the text of the label should be 'text'
    - told the coordinates of the label on the screen 'place(x = ---, y = ---)'
"""

# Hope this helped you. This is a very easy way to place labels on the screen
# which allows us to control the position with ease.

# By Codexel :)
Comment

PREVIOUS NEXT
Code Example
Python :: extract frames from video python 
Python :: python get dir 
Python :: How do you sum consecutive numbers in Python? 
Python :: plt plot circle 
Python :: how to find the calendar week python 
Python :: name exit not defined python 
Python :: discord.py send image 
Python :: ipywidgets pip 
Python :: get list of all files in folder and subfolders python 
Python :: django raise 404 
Python :: django.db.backends.mysql install 
Python :: for e in p.event.get(): pygame.error: video system not initialized 
Python :: import decisiontreeclassifier 
Python :: python convert latitude longitude to x y 
Python :: calculate euclidian distance python 
Python :: python day from date 
Python :: pygame render text 
Python :: how to get the angle of mouse from the center formulae 
Python :: change dataframe column type 
Python :: pyspark find columns with null values 
Python :: send dm discord py 
Python :: sort list by attribute python 
Python :: get current working directory python 
Python :: cv2 videocapture nth frame 
Python :: increase contrast cv2 
Python :: python use .env 
Python :: django python install 
Python :: python clear screen 
Python :: matplotlib grid thickness 
Python :: python float to fraction 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =