pyperclip

Python script to copy text to clipboard [duplicate]

試著忘記壹切 提交于 2019-11-26 19:37:39
This question already has an answer here: How do I copy a string to the clipboard on Windows using Python? 17 answers I just need a python script that copies text to the clipboard. After the script gets executed i need the output of the text to be pasted to another source. Is it possible to write a python script that does this job? robert See Pyperclip . Example (taken from Pyperclip site): import pyperclip pyperclip.copy('The text to be copied to the clipboard.') spam = pyperclip.paste() Also, see Xerox . But it appears to have more dependencies. On mac i use this function. import os data =