clipboard history using python

时间:2017-04-10 00:50:19

标签: python python-3.x clipboard

I am tying to access the clipboard contents using python. I am using the below python script to perform the action.

from tkinter import Tk
r = Tk()
result = r.selection_get(selection="CLIPBOARD")
print(result)

The above snippet helps in fetching the contents that are available in the clipboard currently. My requirement is to fetch the clipboard history completely.

Any suggestions regarding this will be really helpful.

1 个答案:

答案 0 :(得分:-1)

pyperclip非常适合从剪贴板复制和粘贴到剪贴板。

import pyperclip result = pyperclip.paste() print(result)