
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Initialize a Window as Maximized in Tkinter Python
Tkinter creates a default window with its default size while initializing the application. We can customize the geometry of the window using the geometry method.
However, in order to maximize the window, we can use the state() method which can be used for scaling the tkinter window. It maximizes the window after passing the “zoomed” state value to it.
Example
#Import the required libraries from tkinter import * #Create an instance of tkinter frame win= Tk() #Set the geometry of frame win.geometry("600x400") #Create a text label Label(win,text="It takes only 21 days to create a new Habit", font=('Times New Roman bold',15)).pack(pady=20) #Maximize the window using state property win.state('zoomed') win.mainloop()
Output
Running the above code will maximize the tkinter window.
Advertisements