【发布时间】:2020-07-24 06:55:07
【问题描述】:
我正在尝试在 tkinter 中使用文本小部件来显示我的代码的输出。
sequence = ("This peptide contains ", len(Peptide), "total residues", "\n")
text.insert("current", sequence)
这似乎有效,除了打印时, elements are separated by {}.
我希望输出不包含这些括号,并读为:“此肽包含 17 个总残基”。有没有办法做到这一点?
谢谢
【问题讨论】:
-
insert方法需要一个字符串,而不是一个元组。
标签: python tkinter printing insert text-widget