Python tkinter 访问剪贴板

目录

引用自stackoverflow:

from tkinter import Tk
r = Tk()
r.withdraw()
r.clipboard_clear()
r.clipboard_append('i can has clipboardz?')
r.update() # now it stays on the clipboard after the window is closed
r.destroy()

注意:需要启用 tkinter