Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
439 views
in Technique[技术] by (71.8m points)

python - Python 3.x复制到剪贴板而不下载其他库?(Python 3.x copy to clipboard without downloading aditional libraries?)

Is there a way to manage clipboard in python 3.x without the use of tkinter or other downloadable libraries ?

(有没有一种方法可以在不使用tkinter或其他可下载库的情况下在python 3.x中管理剪贴板?)

tkinter is a GUI library, it should have no business in clipboard or file management.

(tkinter是一个GUI库,在剪贴板或文件管理中不应该涉及任何事务。)

I purposely refuse to use tkinter for anything other then GUI.

(我故意拒绝将tkinter用于GUI以外的任何其他用途。)

Thank you.

(谢谢。)

import os
data = "hello world"
os.system("echo '%s' | pbcopy" % data)

the above does not work for windows

(以上不适用于Windows)

  ask by Tony Nameless translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...