MYF

Pursue excellence; Strive for perfection.


  • Home

  • Categories

  • About

  • Archives

  • Tags
MYF

Python3 剪切板的存取

Posted on 2016-10-21 | In 自学 | | Visitors

将内容复制到剪切板

1
2
import os
os.system("echo '%s' | pbcopy" % txt)

扩展:使用该方法可以调用bash指令

1
os.system(" <cmd> ")

读取剪切板中的内容

1
2
import pyperclip
txt = pyperclip.paste()
# Python
每一次AC都是一次感动
Python3 当字节流出现在字符串中
  • Table of Contents
  • Overview
MenYifan

MenYifan

299 posts
9 categories
96 tags
RSS
GitHub LinkedIn Download ACM
  1. 1. 将内容复制到剪切板
  2. 2. 读取剪切板中的内容
© 2019 MenYifan
Powered by Hexo
Theme - NexT.Pisces