-
-
Save Bicarbona/b95310bc697e4127ff5ee3dfd89e10bc to your computer and use it in GitHub Desktop.
Write a python string to the clipboard via pbcopy (OS X)
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
def write_to_clipboard(output): | |
import subprocess | |
process = subprocess.Popen('pbcopy', env={'LANG': 'en_US.UTF-8'}, stdin=subprocess.PIPE) | |
process.communicate(output.encode()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment