0% found this document useful (0 votes)
6 views2 pages

Tkinter Basics Notes

This document provides a basic overview of Tkinter, including how to create a window, add labels, buttons, and entry fields. It explains how to handle button clicks and read user input, as well as how to update widget text dynamically. The document concludes with a summary of key concepts learned about Tkinter.

Uploaded by

aryan.film089
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Tkinter Basics Notes

This document provides a basic overview of Tkinter, including how to create a window, add labels, buttons, and entry fields. It explains how to handle button clicks and read user input, as well as how to update widget text dynamically. The document concludes with a summary of key concepts learned about Tkinter.

Uploaded by

aryan.film089
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Tkinter Basics – Study Notes (English)

1. Creating a Window

- Import Tkinter using: import tkinter as tk

- Create a window: window = [Link]()

- Set a title: [Link]("My App")

- Set size: [Link]("400x300")

- Start the window loop: [Link]()

2. Adding a Label

- A label displays text inside the window.

Example:

label = [Link](window, text="Hello!", font=("Arial", 14))

[Link]()

3. Adding a Button

- A button triggers a function when clicked.

Example:

def on_click():

[Link](text="Button clicked!")

btn = [Link](window, text="Click Me", command=on_click)

[Link]()

4. Getting User Input (Entry)

- Entry is used for text input fields.

Example:

entry = [Link](window)

[Link]()
- Getting the entered value:

value = [Link]()

5. Updating Text Dynamically

- You can change label text using:

[Link](text="New Text")

6. Pack Layout Manager

- pack() arranges widgets vertically in order.

- Useful options:

pack(pady=10) # vertical spacing

pack(side="left") # aligning

7. Summary of What You Learned Today

- How to create a Tkinter window

- How to add label, button, and entry

- How to handle button clicks with functions

- How to read user input

- How to update widgets dynamically

You might also like