Python Tkinter 根标题不起作用 [英] Python Tkinter Root Title doesn't work

查看:35
本文介绍了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.

这篇关于Python Tkinter 根标题不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆