我希望我的python程序在Mac剪贴板中放置一些文本.
这可能吗?
解决方法:
新答案:
This page建议:
Implementation for All Mac OS X
VersionsThe other Mac module
(MacSharedClipboard.py, in Listing 4)
implements the clipboard interface on
top of two command-line programs
called pbcopy (which copies text into
the clipboard) and pbpaste (which
pastes whatever text is in the
clipboard). The prefix “pb” stands for
“pasteboard,” the Mac term for
clipboard.
老答案:
显然是这样的:
http://code.activestate.com/recipes/410615/
是一个简单的脚本,演示如何做到这一点.
编辑:刚刚意识到这依赖于Carbon,所以可能并不理想……取决于你使用它的一点点.