tkinter button with calibri text, with size 15 police in python

Here is an example code to create a Tkinter button with Calibri font and size 15:

main.py
import tkinter as tk

root = tk.Tk()

# Define the Calibri font with size 15
CalibriFont = ('Calibri', 15)

# Create a button with Calibri font
button = tk.Button(root, text="Click me!", font=CalibriFont)

button.pack()

root.mainloop()
237 chars
14 lines

In this code, we import the tkinter module and create the main window with tk.Tk(). Then, we define the Calibri font with size 15 as CalibriFont. Finally, we create the button with the Calibri font using tk.Button() and pack it into the main window with .pack().

related categories

gistlibby LogSnag