【发布时间】:2017-06-14 20:58:21
【问题描述】:
我在使用 tkinter 时遇到问题。 我的代码旨在在按下按钮时打开一个新窗口,但该窗口没有打开。
这是我的代码:
主模块
#!/usr/bin/python
#encoding: latin-1
import tkinter
import ce
#window config
window = tkinter.Tk() #create window
window.title("BBDOassist") #set title
window.geometry("750x500") #set size
…
# buttons
button_ce = tkinter.Button(window, text="CE Evaluation", command="ce.run()")
button_ce.pack()
window.mainloop() #draw the window and start
“CE”模块
#!/usr/bin/python
#encoding: latin-1
import tkinter
…
def run():
#window config
window = tkinter.Tk() #create window
window.title("BBDOassist - CE Evaluation") #set title
window.geometry("750x500") #set size
…
window.mainloop() #draw the window and start
【问题讨论】:
标签: python-3.x tkinter window