Skip to content
This repository has been archived by the owner on Sep 6, 2023. It is now read-only.

Python操作剪贴板 #38

Open
jwenjian opened this issue Jun 24, 2019 · 0 comments
Open

Python操作剪贴板 #38

jwenjian opened this issue Jun 24, 2019 · 0 comments

Comments

@jwenjian
Copy link
Owner

安装依赖

pip install pyperclip

示例代码

import pyperclip

def copy_to_clipboard(command: str):
    pyperclip.copy(str(command))

if __name__ == '__main__':
    copy_to_clipboard("Hello, world!")
    copied_str = pyperclip.paste()
    print(copied_str) # Hello, world!

gist
pyperclip

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant