[英]I want a single button to do double command one command will terminate my present window and another command will open a new window in tkinter
def newwindow():
-----------
def exit():
exit()
root=Tk()
signup=Button(root,text="Sign Up",command=[ newwindow(),exitt() ],
width=12,bg='green',fg='white',font=("arial",12,'bold'))
使用 function 作为命令:
def newwindow():
-----------
def myexit():
exit()
def my_command():
newwindow()
myexit()
root=Tk()
signup=Button(root,text="Sign Up",command=mycommand,
width=12,bg='green',fg='white',font=("arial",12,'bold'))```
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.