How to make labels with tkinter in python

This video is for begginers with tkinter that want to learn easily how this module for graphic user interface for python works, with a little bit of class usage, so, it’s not a very basic tutorial, but has some basic informations about too, in case you want to know what they are for, explained in a very simple way.

import tkinter as tk


class Win:
	def __init__(self):
		self.root = tk.Tk() # the window
		self.root.geometry("400x400")
		self.label()

	def label(self):
		self.lab1 = tk.Label(self.root,
			text="Hello",
			font="Arial 20",
			bg="gold",
			fg="red")
		self.lab1.pack(
			fill="both",
			expand=True
			)


app = Win()
app.root.mainloop()

Subscribe to the newsletter for updates
Tkinter templates
Avatar My youtube channel

Twitter: @pythonprogrammi - python_pygame

Videos

Speech recognition game

Pygame's Platform Game

Other Pygame's posts

Published by pythonprogramming

Started with basic on the spectrum, loved javascript in the 90ies and python in the 2000, now I am back with python, still making some javascript stuff when needed.