Here we are going to get a list of all available fonts in Tkinter. From this we are going to get an idea of what are the available fonts present in them.
We can able to get a knowledge about them and we can able to list them according to their available fonts.
Algorithm
- At first we are going to import the Tkinter.
- Then we will give the dimensions to the window.
- We will use def keyword to define it.
- Give a required text for print.
- We will use the button to get output.
- At last we will use the main loop.
Source Code
here is the code.
import tkinter as tk
window=tk.Tk()
window.geometry("600x600")
def red(m):
print(m)
m=" hurray you clicked me....!"
button=tk.Button(window,text="HELLO! Click ME",command=lambda: red(m))
button.pack()
window.mainloop()
Output:
hurray you clicked me....!