代码:
# title
root = tk.Tk()
root.geometry("400x300")
root.title("个人财务管理")
# 标签
custom_font = font.Font(size=20)
label = tk.Label(root, text="个人财务管理", bg="#fff799", width=110, height=3, padx=5, pady=5, borderwidth=3, bd=2,
font=custom_font)
label.pack()
label2 = tk.Label(root, text="欢迎您的使用!", width=110, height=3, padx=5, pady=10, borderwidth=3, bd=2,
font=custom_font)
label2.pack()
# 按钮
b1 = Button(root, text="注册", bg="#fff799", font=(14), command=register).place(x=100, y=200, width=80, height=40)
b2 = Button(root, text="登录", bg="#fff799", font=(14), command=login).place(x=220, y=200, width=80, height=40)
root.mainloop()
界面: