How to set window size in Tkinter Python?

0 votes

Hi. I am using the following code, but the window is too small. I want to make the window big in size. How can I do it?

from Tkinter import *

root = Tk()

Label(root, text="Red Sun", bg="red", fg="white").pack()

Label(root, text="Green Grass", bg="green", fg="black").pack()

Label(root, text="Blue Sky", bg="blue", fg="white").pack()
May 8 in Python by Raj
213 views

1 answer to this question.

0 votes

The window size adjustment can be done using geometry method. Add this at the end of the code:

root.geometry('500*500')

Note: This will only change the window size, the label size will still be the same.

answered May 8 by Giri

Related Questions In Python

0 votes
1 answer

How to get the size of a string in Python?

If you are talking about the length ...READ MORE

answered Jun 4, 2018 in Python by ariaholic
• 7,340 points
98 views
–1 vote
2 answers

How to find the size of a string in Python?

following way to find length of string  x ...READ MORE

answered Mar 29 in Python by rajesh
• 1,210 points
92 views
0 votes
1 answer

How to get permutations of list or a set in Python?

Permutation is an arrangement of objects in ...READ MORE

answered Jul 11 in Python by Neel
• 3,010 points
46 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 281 views
+4 votes
6 answers
0 votes
1 answer

Python Tkinter: “‘Label’ unresolved” error

You have imported Tkinter as tk but ...READ MORE

answered May 8 in Python by Rishi
62 views
0 votes
2 answers

Tkinter “module not callable” error.

This error statement TypeError: 'module' object is ...READ MORE

answered Jun 27 in Python by rahul
• 200 points
453 views