點第一個注冊按鈕為什麼會執行第二個注冊按鈕的函數啊,求解惑
from tkinter import *
import os
from unittest import expectedFailure
user="user.txt"
passwd="passwd.txt"
def show1():
root=Tk()
root.geometry("400x200+800+350")
root.title("大")
label=Label(root,text="注冊",font=("華文行楷",20),fg="green",bg="pink")
label.pack()
#global value1
#value1=Tk.StringVar()
number3=Label(root,text="用戶名")
number3.place(relx=0.2,rely=0.2,anchor=CENTER)
text3=Entry(root)
text3.place(relx=0.5,rely=0.2,anchor=CENTER,width=150,height=25)
#global value2
#value2=Tk.StringVar()
number4=Label(root,text="密碼")
number4.place(relx=0.2,rely=0.4,anchor=CENTER)
text4=Entry(root)
text4.place(relx=0.5,rely=0.4,anchor=CENTER,width=150,height=25)
enter=Button(root,text="注冊1",command=register())
enter.place(relx=0.5,rely=0.8,anchor=CENTER)
#a=str(text3.get())
#b=str(text4.get())
def register():
root=Tk()
root.geometry("200x50+900+450")
root.title("大")
label=Label(root,text="注冊成功",font=("華文行楷",20),fg="green",bg="pink")
label.pack()
def sighin():
print("sighin")
root=Tk()
root.geometry("400x200+800+350")
root.title("大")
label=Label(root,text="登錄",font=("華文行楷",20),fg="green",bg="pink")
label.pack()
number1=Label(root,text="用戶名")
number1.place(relx=0.2,rely=0.2,anchor=CENTER)
text1=Entry(root)
text1.place(relx=0.5,rely=0.2,anchor=CENTER,width=150,height=25)
label.pack()
number2=Label(root,text="密碼")
number2.place(relx=0.2,rely=0.4,anchor=CENTER)
text2=Entry(root)
text2.place(relx=0.5,rely=0.4,anchor=CENTER,width=150,height=25)
enter1=button1=Button(root,text="注冊",command=show1)
enter1.place(relx=0.5,rely=0.8,anchor=CENTER)
enter2=button2=Button(root,text="登錄",command=sighin)
enter2.place(relx=0.5,rely=0.6,anchor=CENTER)
root.mainloop()