Answers for "python tkinter font size"

7

tkinter change font family and size of label

from tkinter import *
import tkinter.font as font

gui = Tk(className='Python Examples - Button')
gui.geometry("500x200")

# define font
myFont = font.Font(family='Helvetica', size=20, weight='bold')

# create button
button = Button(gui, text='My Button', bg='#0052cc', fg='#ffffff')
# apply font to the button label
button['font'] = myFont
# add button to gui window
button.pack()

gui.mainloop()
Posted by: Guest on April-14-2020
5

python tkinter define window size

window = Tk()
#set window size
window.geometry("widthxheight")
Posted by: Guest on June-28-2020
0

python tkinter get image size

img = Image.open("path\\to\\image.jpg")
tkimage = ImageTk.PhotoImage(img)

h = tkimage.height()
w = tkimage.width()
print(h)
print(w)
Posted by: Guest on October-02-2020
-1

how to change font size of all widgets in tkinter

root.option_add('*Font', '19')
Posted by: Guest on September-06-2021

Python Answers by Framework

Browse Popular Code Answers by Language