On Tue, Mar 22, 2016 at 2:36 PM, Wildman via Python-list <python-list@python.org> wrote: > Thanks. I changed the code as you (and MRAB) suggested. > > def copy_clipboard(self): > try: > text2copy = self.text.get(tk.SEL_FIRST, tk.SEL_LAST) > except tk.TclError: > text2copy = self.text.get() > root.clipboard_clear() > root.clipboard_append(text2copy) > > Works perfectly. Thanks again.
Looks good! For future reference, and for others reading, this was a great question. You posted actual code, with a specific question, and it was easy to figure out what's going on. Thank you. ChrisA -- https://mail.python.org/mailman/listinfo/python-list