Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to create a label in tkinter

# Hello there. Here is how you can create a label in tkinter.

# Import tkinter
from tkinter import * # * just means all

window = Tk() # Creates a window which the label can be placed on
win_label = Label(window, text = "Type Text Here") # Creates a label and tells where it should be placed i.e. the window    
win_label.pack() # We pack our label separately here so that it can be seen on the window as we were just creating the label before    
window.mainloop() # Runs the program and keeps the window on the screen and tells it stay on the screen until closed

# This was how you create a label. Simple and easy as you can see! Please upvote
# if you found this helpful!

# By Codexel
 
PREVIOUS NEXT
Tagged: #create #label #tkinter
ADD COMMENT
Topic
Name
4+8 =