Skip to content

Instantly share code, notes, and snippets.

@dl6nm
Created February 10, 2020 09:40
Show Gist options
  • Save dl6nm/3a1a09720eab2ab6e2eaabc357e5b6fd to your computer and use it in GitHub Desktop.
Save dl6nm/3a1a09720eab2ab6e2eaabc357e5b6fd to your computer and use it in GitHub Desktop.
Add text from Python to the Windows clipboard
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