+ 1

do you know how to implement this?

I want to do in tkinter program on python the code in which there will be input field, and when you click on button this text from input field will be copied to the clipboard in python

4th Sep 2024, 5:37 PM
Wolf Cub
Wolf Cub - avatar
3 Answers
+ 2
I found this solution on stack overflow. from tkinter import Tk # in Python 2, use "Tkinter" instead r = Tk() r.withdraw() r.clipboard_clear() r.clipboard_append('i can has clipboardz?') r.update() # now it stays on the clipboard after the window is closed r.destroy() Another comment suggested that once you do the r.destroy() that the clipboard is erased, so consider skipping that last line. I've not tested this code.
4th Sep 2024, 6:24 PM
Jerry Hobby
Jerry Hobby - avatar
+ 1
ok, I'll watch it
4th Sep 2024, 7:53 PM
Wolf Cub
Wolf Cub - avatar
+ 1
Jerry Hobby thanks it works.
5th Sep 2024, 5:27 AM
Wolf Cub
Wolf Cub - avatar