Python脚本将文本复制到剪贴板 [英] Python script to copy text to clipboard

查看:512
本文介绍了Python脚本将文本复制到剪贴板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只需要一个将文本复制到剪贴板的python脚本。

I just need a python script that copies text to the clipboard.

执行脚本后,我需要将文本输出粘贴到另一个源。
是否可以编写完成此任务的python脚本?

After the script gets executed i need the output of the text to be pasted to another source. Is it possible to write a python script that does this job?

推荐答案

请参见 Pyperclip 。示例(取自Pyperclip网站):

See Pyperclip. Example (taken from Pyperclip site):

import pyperclip
pyperclip.copy('The text to be copied to the clipboard.')
spam = pyperclip.paste()

另外,请参见施乐。但是它似乎有更多的依赖性。

Also, see Xerox. But it appears to have more dependencies.

这篇关于Python脚本将文本复制到剪贴板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆