Clipboard is not set after application exits?

六月ゝ 毕业季﹏ 提交于 2019-12-23 20:54:38

问题


With this example from How do I copy a string to the clipboard on Windows using Python? :

from tkinter import Tk
r = Tk()
r.withdraw()
r.clipboard_clear()
r.clipboard_append('i can has clipboardz?')
r.destroy()

The clipboard reverts to the old clipboard. Is there any way to avoid this? I'm using Ubuntu 13.04.


回答1:


No. The "clipboard" on X is not a discrete thing, but rather a notification that an application contains the piece of data that is seen as being "on" the clipboard. Other applications request this piece of data from that application, and the data is returned. This cannot work if the application that is supposed to respond with the data is no longer running.



来源:https://stackoverflow.com/questions/20866593/clipboard-is-not-set-after-application-exits

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!