我想要标签自动换行内的输出。我看到很多人使用函数wrap length,但当我这样使用它时
label_out.place(relx=0, rely=0.05, relwidth=1, relheight=0.95, wraplengt=200)
它表明
TclError: unknown option "-wraplength"
我知道我现在哪里做错了,我纠正我的代码到这个
final_text = ' '.join([lemmatizer.lemmatize(w) for w in stemmed])
label_out = Label(root,font="helvetica 14", wraplength=300,justify="center")
label_out['text'] = final_text
现在我又犯了一个错误
AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'tk'
正如错误所说
Label.place
不支持wraplength
选项wraplength
用于小部件。您可以将代码更改为以下内容我只是找到了解决办法。起初,我认为wraplength应该放在决赛中,但我错了(不是完全错),它不应该放在这样的位置
相反,它应该这样说
大部分答案都用一句话来表达。事实上,它可以这样写
使用这种方法,您(我)可以将有关UI的所有内容放在代码的末尾,只在代码的上部留下变量
相关问题 更多 >
编程相关推荐