Skip to content

Instantly share code, notes, and snippets.

@fengxuway
Created August 27, 2016 08:54
Show Gist options
  • Save fengxuway/5f4122e732af57de07e7150c8a60e54a to your computer and use it in GitHub Desktop.
Save fengxuway/5f4122e732af57de07e7150c8a60e54a to your computer and use it in GitHub Desktop.
python读取OSX剪贴板
import subprocess
def getClipboardData():
p = subprocess.Popen(['pbpaste'], stdout=subprocess.PIPE)
retcode = p.wait()
data = p.stdout.read()
return data
@PoplarYang
Copy link

文字能读成功,图片读不到

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment