如下所示:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#-*- encoding:utf-8 -*-
from tkinter import *
root = tk()
def create():
top = toplevel()
top.title( 'python' )
v1 = stringvar()
e1 = entry(top,textvariable = v1,width = 10 )
e1.grid(row = 1 ,column = 0 ,padx = 1 ,pady = 1 )
button(top, text = '出现2级' ).grid(row = 1 ,column = 1 ,padx = 1 ,pady = 1 )
button(root, text = '点击1级' , command = create).pack()
mainloop()
|
以上这篇python3 tkinter实现点击一个按钮跳出另一个窗口的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持服务器之家。
原文链接:https://blog.csdn.net/qq_35516165/article/details/81153535