Python Tkinter 根标题不起作用
问题描述:
我似乎无法为我的窗口命名.他们都有标题Tk".我相信我的代码是正确的,所以如果这是错误的,请纠正我......
I can't seem to title my windows. They all have the title "Tk".I believe my code is correct, so correct me if this is wrong...
from Tkinter import *
root = Tk()
root.title="Title"
root.mainloop()
标题仍然是Tk().我可以 from Tkinter import Tk as MyTitle
吗?
The title is still Tk(). Could I maybe from Tkinter import Tk as MyTitle
?
答
root.title("Title")
试试看,它是你调用并传入参数的方法.
Try that, its a method you invoke and pass in the parameter.