我在tkinter中打开文本框小部件时遇到问题
self.usrText1 = Text(self.usrDetailsFrame, height=4, width=15)
self.usrText1.insert(END, "Enter Text")
self.usrText1.grid(row=8, column=1, sticky=W, padx=3)
现在,当我尝试用一个包含多行的字符串更新文本框时,我得到了一个字符串的包装版本,这会导致"\n".join(self.person.getBooks())
中格式非常好的字符串失真
self.usrText1.delete("1.0",END)
self.usrText1.insert(END,"\n".join(self.person.getBooks()))
如何打开文本框?或者添加滚动条?请注意,我使用的是Python2.7,谢谢
对文本小部件使用文档化的
wrap
选项:相关问题 更多 >
编程相关推荐