import tkinter as tk
HEIGHT = 950
WIDTH = 650
root=tk.Tk()
canvas = tk.Canvas(root, height=HEIGHT, width=WIDTH)
canvas.pack()
frame = tk.Frame(root, bg='#80c1ff')
frame.place(relx=0.5, rely=0.1, relwidth=0.75, relheight=0.1, anchor='n')
button = tk.Button(frame, text="Credit Score Checker", font=20)
button.place(relx=-0, relheight=1, relwidth=0.27)
button = tk.Button(frame, text="Financial Advisor", font=20)
button.place(relx=0.25, relheight=1, relwidth=0.27)
button = tk.Button(frame, text="Insurance Planner", font=20)
button.place(relx=0.5, relheight=1, relwidth=0.27)
button = tk.Button(frame, text="Goal Setter", font=20)
button.place(relx=0.75, relheight=1, relwidth=0.26)
lower_frame = tk.Frame(root, bg='#80c1ff', bd=10)
lower_frame.place(relx=0.5, rely=0.25, relwidth=0.75, relheight=0.6, anchor='n')
label = tk.Label(lower_frame, text="Summary of finances", bg='grey')
label.place(relx=0.5, rely=0, anchor='n', relwidth=0.9, relheight=1)
root.mainloop()
答案 0 :(得分:0)
代替字体= 20 您可以使用
font = ("Helvetica",20,"bold")
#font=(font-family , font-size , "bold"/"italic")
您还可以执行以下操作
font = "Helvetica 20 bold"
关于tkinter的笔记,您可以访问 https://mycodenotein.netlify.app