Answers for "how to copy text in 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
0

copy text python

import pyperclip
pyperclip.copy('The text to be copied to the clipboard.')
spam = pyperclip.paste()
Posted by: Guest on April-12-2021

Code answers related to "how to copy text in python"

Python Answers by Framework

Browse Popular Code Answers by Language