How to change font and size of buttons and frame in tkinter using python?

Viewed 81391

This is the code that i used to generate a simple text box and a button in tkinter.

What should be the parameters to have a better look of the frame and buttons?

 root = Tk.Tk()

 def submit():
    query = entry.get()
    retrieve(query)
    entry = Tk.Entry(root)
    entry.pack()
    button = Tk.Button(root, text='submit', command=submit)
    button.pack()
    root.mainloop()             
3 Answers

use the command font = font.Font(size = 20) to change the looking of text in button

import tkinter.font as fnt
import tkinter as tk
r=tk.Tk()
tk.Button(r,text = "Test", font = fnt.Font(size = 20))
r.mainloop()
Related