Last active
September 14, 2022 14:32
-
-
Save perseoq/c357964b5b66083b627fbb314dc7b5a2 to your computer and use it in GitHub Desktop.
Insert HTML tag in a selected text / tkinter (Text Widget) / [Replace text selected with new text]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def bold(self): | |
selexion = self.mensaje.get(SEL_FIRST, SEL_LAST) # get original string | |
rpl = " <p>" + selexion + "</p> " # costruct new string | |
self.mensaje.insert(INSERT,rpl) # insert new string | |
self.mensaje.delete(SEL_FIRST,SEL_LAST) # delete old string | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How is it possible? Just what I needed!!! Thanks a lot.