Giới thiệu sản phẩm
import tkinter as tk
import random
def lol():
name = entry_name.get()
chao.config(text=f"Xin chào {name}")
def open_new_window(message):
new_win = tk.Tk()
new_win.title("Hi")
new_win.geometry("300x200")
label = tk.Label(new_win, text=message, font=("Arial", 20))
label.pack(expand=True)
new_win.mainloop()
def lb():
root.config(bg="lightblue")
def red():
root.config(bg="red")
#chat gpt help phan ngau nhien
def rd():
cl=["red","orange","yellow","lime","green","blue","lavender","lightblue","black","white"]
rd1 = random.choice(cl)
root.config(bg=rd1)
def de():
root.destroy()
open_new_window("lol")
root=tk.Tk()
root.title("Login")
root.geometry("600x800")
tk.Label(root, text="name pls:").pack()
entry_name=tk.Entry(root)
entry_name.pack()
tk.Button(root, text=" ",command=lol).pack(pady=10)
chao = tk.Label(root, text="", font=("Arial", 12))
chao.pack(pady=10)
tk.Button(root, text="lightblue", command=lb).pack(pady=2)
tk.Button(root, text="red", command=red).pack(pady=2)
tk.Button(root, text="can't choose?", command=rd).pack(pady=2)
tk.Button(root, text="another", command=de).pack(pady=2)
root.mainloop()
#Yeu cau1:Dang nhap ten vao o,roi press the button,va hien thi xin chao,ten.
#2:Bam vao nut doi mau,thay doimau sac.
import random
def lol():
name = entry_name.get()
chao.config(text=f"Xin chào {name}")
def open_new_window(message):
new_win = tk.Tk()
new_win.title("Hi")
new_win.geometry("300x200")
label = tk.Label(new_win, text=message, font=("Arial", 20))
label.pack(expand=True)
new_win.mainloop()
def lb():
root.config(bg="lightblue")
def red():
root.config(bg="red")
#chat gpt help phan ngau nhien
def rd():
cl=["red","orange","yellow","lime","green","blue","lavender","lightblue","black","white"]
rd1 = random.choice(cl)
root.config(bg=rd1)
def de():
root.destroy()
open_new_window("lol")
root=tk.Tk()
root.title("Login")
root.geometry("600x800")
tk.Label(root, text="name pls:").pack()
entry_name=tk.Entry(root)
entry_name.pack()
tk.Button(root, text=" ",command=lol).pack(pady=10)
chao = tk.Label(root, text="", font=("Arial", 12))
chao.pack(pady=10)
tk.Button(root, text="lightblue", command=lb).pack(pady=2)
tk.Button(root, text="red", command=red).pack(pady=2)
tk.Button(root, text="can't choose?", command=rd).pack(pady=2)
tk.Button(root, text="another", command=de).pack(pady=2)
root.mainloop()
#Yeu cau1:Dang nhap ten vao o,roi press the button,va hien thi xin chao,ten.
#2:Bam vao nut doi mau,thay doimau sac.
Hình ảnh sản phẩm
Sản phẩm cùng tác giả
Sản phẩm liên quan
Không có sản phẩm nào
Đăng nhập để tham gia bình luận