Created
December 19, 2013 16:00
-
-
Save XuankangLin/8041594 to your computer and use it in GitHub Desktop.
Copy to clipboard in mac os x (in python)
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 subprocess | |
| def setClipboardData(data): | |
| p = subprocess.Popen(['pbcopy'], stdin=subprocess.PIPE) | |
| p.stdin.write(data) | |
| p.stdin.close() | |
| retcode = p.wait() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment