0

I am trying to use a text widget in tkinter to display the output of my code.

sequence = ("This peptide contains ", len(Peptide), "total residues", "\n")
text.insert("current", sequence)

this seems to work, except for that when it is printed, the elements are separated by {}.

I would prefer for the output to not have these parenthesis, and read like: "This peptide contains 17 total residues". Is there a way to do this?

Thank you

1
  • The insert method expects a string, not a tuple. Commented Jul 24, 2020 at 12:41

1 Answer 1

2

It is because sequence is a tuple. Try changing it to

sequence = "This peptide contains {} total residues\n".format(len(Peptide))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.