import tkinter as tk
from tkinter import messagebox
from PIL import Image, ImageTk
root = tk.Tk()
root.title("逻辑网")
root.iconbitmap('../image/icon.ico')
root.resizable(0, 0)
tk.Label(root, text="用户名").grid(row=0, sticky="w")
tk.Label(root, text="密码").grid(row=1, sticky="w")
tk.Entry(root).grid(row=0, column=1)
tk.Entry(root, show="*").grid(row=1, column=1)
image = Image.open("../image/eyes.png")
photo = ImageTk.PhotoImage(image)
tk.Label(root, image=photo).grid(row=0, column=2, rowspan=2, padx='4px', pady='5px')
def login():
messagebox.showinfo("温馨提示", '你很穷!')
tk.Button(root, text="登录", width=10, command=login).grid(row=3, column=0, columnspan=2, sticky="w", padx=10, pady=5)
tk.Button(root, text="退出", width=10, command=root.quit).grid(row=3, column=1, columnspan=2, sticky="e", padx=10,
pady=5)
root.mainloop()