I have a Text widget and a button that is supposed to sort the Text's contents alphabetically.
This time I won't ask you how to do it, I'll rather ask you to correct me.
This is how I solved the problem:
unsortedT = text1.get(1.0, END).replace("\n", "\n*").split("*") sortedT = sorted(unsortedT) text1.delete(1.0, END) text1.insert(END, "".join(sortedT)) by the way, the user is always told to write the contents in the following format: word1 word2 word3
How bad/unelegant is it?