Answers for "copy selected text in program python"

1

How to copy any text using python

from tkinter import Tk

def Copy(txt):
    r = Tk()
    r.withdraw()
    r.clipboard_clear()
    r.clipboard_append(str(txt))
    r.update() # now it stays on the clipboard after the window is closed
    r.destroy()
Copy("It Works")
Posted by: Guest on July-29-2021

Code answers related to "copy selected text in program python"

Python Answers by Framework

Browse Popular Code Answers by Language