Python I GUI programming: Image and text I

Опубликовано: 05 Июнь 2026
на канале: ANDREEs
610
7

Here's the code to help you get started:
import tkinter as tk
root = tk.Tk()
label1 = tk.Label(root, text = "my text is here").pack(side="left")
image1 = tk.PhotoImage(file="Untitled.GIF")
label2 = tk.Label(root, image = image1).pack()
root.mainloop()
____________________________________________________________________
Here, we'll start by using the "Label" widget to create text and images.

Here are the other widgets you can create with tkinter:

Button: Button, button – click it and something happens
Canvas: Can hold graphics and drawings
Checkbutton: Clickable selection
Entr:y: Single-line input field
Label: Text label for labels
LabelFrame: Labeled frame
Listbox: List with selections
Menu: Context menu
Menubutton: Button for the context menu
OptionMenu: Button that displays a selection list when clicked
Radiobutton: Check box; unlike checkbuttons, only one within a group can be selected
Scrollbar: Scroll bar
Spinbox: Numeric value selection field
Text: Multi-line text input field
Widget base class: Base class of a control (all basic functions available for all widgets)

Here's an easy introduction to programming with the increasingly popular programming language "Python."

In this video, I'll show you how to start programming your own GUI with tkinter and how to insert simple text and images. We'll start by using the pack layout.
Sounds are from the YouTube library.
Video/images from pexels.com