How to set the font size of Entry widget in Tkinter?


The Entry widget in tkinter is a basic one-line character Entry box that accepts single line user input. To configure the properties of the Entry widget such as its font-size and width, we can define an inline widget constructor.

Example

Here is an example of how you can define the font-size of the Entry widget.

# Import the required libraries
from tkinter import *
from tkinter import ttk

# Create an instance of tkinter frame or window
win=Tk()

# Set the size of the window
win.geometry("700x350")

# Create an Entry widget
entry=Entry(win, width=35, font=('Georgia 20'))
entry.pack()

win.mainloop()

Output

Run the above code to display a window with a customized Entry widget.

Updated on: 05-Aug-2021

4K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements