我有几个文本框想要放入我的程序中。对于每一个,我都希望有文本来解释要输入的内容。我在更复杂的非 Python 程序中见过它们。
而不是做类似的事情:
from Tkinter import *
top = Tk()
L1 = Label(top, text="User Name")
L1.pack( side = LEFT)
E1 = Entry(top, bd =5)
E1.pack(side = RIGHT)
top.mainloop()
我宁愿这样:Like This
tkinter 中有类似的东西吗?感谢您的帮助。
最佳答案
你可以这样做:
top = Tk()
E1 = Entry(top, bd =5)
E1.insert(0, "User Name")
E1.pack(side = RIGHT)
top.mainloop()
关于python - 文本叠加在文本框中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18092223/