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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…