如何在tkinter条目中预览文本(Python)

问题描述 投票:0回答:1

因此,在用户向文本框中输入任何内容之前,如何让其预览显示“输入您的姓名”或类似内容?e.g.

userName = Entry(text="Username", font = ('Arial', 15), bg = 'white').place(relx = 0.55, rely = 0.35)
#userName.insert(0, "User name")
password = Entry(text="Password", font = ('Arial', 15), bg = 'white',show = '•').place(relx = 0.55, rely = 0.43)
#password.insert(0, "Password")
python tkinter
1个回答
0
投票

尝试一下:

text = Text(parent, width=40, height=10)
text.insert('1.0', 'here is my text to insert')

有关更多信息,请参见:the tk docs

© www.soinside.com 2019 - 2024. All rights reserved.