Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在 tkinter 中使用文本小部件来显示我的代码的输出。
sequence = ("This peptide contains ", len(Peptide), "total residues", "\n") text.insert("current", sequence)
这似乎有效,除了在打印时, 元素由 {} 分隔。
我希望输出没有这些括号,并且读起来像:“这个肽包含 17 个总残基”。有没有办法做到这一点?
谢谢
这是因为sequence是一个tuple. 尝试将其更改为
sequence
tuple
sequence = "This peptide contains {} total residues\n".format(len(Peptide))