Automatically copy Tkinter text widget content to clipboard? Automatically copy Tkinter text widget content to clipboard? tkinter tkinter

Automatically copy Tkinter text widget content to clipboard?


This link can help you:

Link

from Tkinter import Tkr = Tk()r.withdraw()r.clipboard_clear()r.clipboard_append('i can has clipboardz?')r.destroy()


Here's a little function that I used in one of my apps, which I attached to a tkinter button. You will need to change the "INFO_TO_COPY" comment to your actual data source.

def copy_button():    clip = Tk()    clip.withdraw()    clip.clipboard_clear()    clip.clipboard_append(INFO_TO_COPY)  // Change INFO_TO_COPY to the name of your data source    clip.destroy()

Hope this helps!


I'm away from any sort of documentation but if I recall correctly win.clipboard_append(output) should work for your case here