Last active
August 29, 2015 14:03
-
-
Save pestilence669/56e18917f53b8613fb2a to your computer and use it in GitHub Desktop.
Copies a string into the clipboard... on a Mac.
This file contains 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
#!/usr/bin/env python | |
# vim: set ts=4 sw=4 noet: | |
import argparse | |
def shoveIntoClipboard(contents): | |
"Copies a string into the clipboard... on a Mac" | |
p = subprocess.Popen(['pbcopy'], stdin = subprocess.PIPE) | |
p.stdin.write(contents) | |
p.stdin.close() | |
return p.wait() == 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment