- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to update information in the grid in Tkinter?
Let us suppose that a Tkinter application has widgets placed in the window using the Grid Geometry Manager. In order to change the properties of the Tkinter widgets, we can use configure(**options) method. While rendering the widgets in the window, we have to assign the constructor to a variable that gives access to change the widget’s property globally.
Example
# Import the required libraries from tkinter import * # Create an instance of tkinter frame or window win=Tk() # Set the size of the window win.geometry("700x350") # Add a Label widget and assign it to a new variable label=Label(win, text="This is Houstan Control. " "We've detected a new Mission", background="skyblue",font=('Aerial 11')) label.grid(row=0, column=2) win.mainloop()
Output
Running the above code will display a window that has a label widget aligned to the leftmost of the window.
Advertisements