I'm trying to write a Python program that gets a string as input and displays the string in a message box with the last letter removed from each word. I've successfully written the code to remove the last letter from each word and I came to know about the tkinter module. But the text isn't copy-able from tk message box. Is there any other way to display a message box with copy-able text? If there's no way to display such message boxes, is there any way to display the output in a copy-able form without displaying a message box? Additional (useless) information:
- The name of this language is fromonk(In case you were wondering why the var name fromonk_text)
- Smileys should be displayed in whole.(Including the last letter).Hence the if-else block.
The code I've written:
import tkMessageBox
line="foo"
while line!="exit":
fromonk_text=""
line=raw_input()
words=line.split()
for word in words:
if word.startswith(":"):
fromonk_text+=word+" "
else:
fromonk_text+=word[0:len(word)-1]+" "
tkMessageBox.showinfo("Fromonk",fromonk_text)