Created
February 10, 2020 09:40
-
-
Save dl6nm/3a1a09720eab2ab6e2eaabc357e5b6fd to your computer and use it in GitHub Desktop.
Add text from Python to the Windows clipboard
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
def addToClipBoard(text): | |
command = 'echo ' + text.strip() + '| clip' | |
os.system(command) | |
#example | |
addToClipBoard('Hello') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment